set the default ave ping time to 999 to prevent take overs from newly
authorminima <minima>
Mon, 3 Sep 2001 19:59:24 +0000 (19:59 +0000)
committerminima <minima>
Mon, 3 Sep 2001 19:59:24 +0000 (19:59 +0000)
connected interfaces and set the first pings to go off immediately
after initialisation.

perl/DXProt.pm

index f5b6a81860d6a85a4ce5478d2322429f3ff3f86e..9d92a8293099060c42bc16cd936b69b4eb358153 100644 (file)
@@ -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;
                }