From: minima Date: Mon, 3 Sep 2001 19:59:24 +0000 (+0000) Subject: set the default ave ping time to 999 to prevent take overs from newly X-Git-Tag: R_1_48~52 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8b7744ab5cbdada26c56635b20c8d9715104153;p=spider.git 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. --- 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; }