From c8b7744ab5cbdada26c56635b20c8d9715104153 Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 3 Sep 2001 19:59:24 +0000 Subject: [PATCH] set the default ave ping time to 999 to prevent take overs from newly connected interfaces and set the first pings to go off immediately after initialisation. --- perl/DXProt.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/perl/DXProt.pm b/perl/DXProt.pm index f5b6a818..9d92a829 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -254,15 +254,14 @@ sub start $self->{pingint} = $ping; $self->{nopings} = $user->nopings || 2; $self->{pingtime} = [ ]; - $self->{pingave} = 0; + $self->{pingave} = 999; + $self->{lastping} = $main::systime; # send initialisation string unless ($self->{outbound}) { $self->send(pc18()); - $self->{lastping} = $main::systime; - } else { - $self->{lastping} = $main::systime + ($self->pingint / 2); } + $self->state('init'); $self->{pc50_t} = $main::systime; @@ -753,6 +752,7 @@ sub normal $self->send_local_config(); $self->send(pc22()); $self->state('normal'); + $self->{lastping} = 0; return; } @@ -798,6 +798,7 @@ sub normal if ($pcno == 22) { $self->state('normal'); + $self->{lastping} = 0; return; } -- 2.34.1