]> dxcluster.net Git - spider.git/commitdiff
fixed the default fo set/login to off not on
authordjk <djk>
Sun, 21 Nov 1999 17:19:28 +0000 (17:19 +0000)
committerdjk <djk>
Sun, 21 Nov 1999 17:19:28 +0000 (17:19 +0000)
perl/DXProt.pm
perl/DXUser.pm

index e65cad70a799ddc53af94e0fb45279ca2745d201..710a3dbf84129a4b0405fc92597c8ff2cd7e2161 100644 (file)
@@ -129,19 +129,20 @@ sub start
        # ping neighbour node stuff
        my $ping = $user->pingint;
        $ping = 5*60 unless defined $ping;
-       $self->pingint($ping);
-       $self->nopings($user->nopings || 2);
-       $self->pingtime([ ]);
+       $self->{pingint} = $ping;
+       $self->{nopings} = $user->nopings || 2;
+       $self->{pingtime} = [ ];
+       $self->{pingave} = 0;
 
        # send initialisation string
        unless ($self->{outbound}) {
                $self->send(pc38()) if DXNode->get_all();
                $self->send(pc18());
-               $self->lastping($main::systime);
+               $self->{lastping} = $main::systime;
        } else {
                # remove from outstanding connects queue
                @main::outstanding_connects = grep {$_->{call} ne $call} @main::outstanding_connects;
-               $self->lastping($main::systime + $self->pingint / 2);
+               $self->{lastping} = $main::systime + $self->pingint / 2;
        }
        $self->state('init');
        $self->pc50_t(time);
@@ -721,18 +722,18 @@ sub normal
                                                        my $t = tv_interval($r->{t}, [ gettimeofday ]);
                                                        if ($dxchan->is_user) {
                                                                my $s = sprintf "%.2f", $t; 
-                                                               my $ave = sprintf "%.2f", $tochan ? ($tochan->pingave || $t) : $t;
+                                                               my $ave = sprintf "%.2f", $tochan ? ($tochan->{pingave} || $t) : $t;
                                                                $dxchan->send($dxchan->msg('pingi', $field[2], $s, $ave))
                                                        } elsif ($dxchan->is_ak1a) {
                                                                if ($tochan) {
-                                                                       $tochan->nopings(3); # pump up the timer
-                                                                       push @{$tochan->pingtime}, $t;
-                                                                       shift @{$tochan->pingtime} if @{$tochan->pingtime} > 6;
+                                                                       $tochan->{nopings} = 2; # pump up the timer
+                                                                       push @{$tochan->{pingtime}}, $t;
+                                                                       shift @{$tochan->{pingtime}} if @{$tochan->{pingtime}} > 6;
                                                                        my $st;
-                                                                       for (@{$tochan->pingtime}) {
+                                                                       for (@{$tochan->{pingtime}}) {
                                                                                $st += $_;
                                                                        }
-                                                                       $tochan->{pingave} = $st / @{$tochan->pingtime};
+                                                                       $tochan->{pingave} = $st / @{$tochan->{pingtime}};
                                                                }
                                                        } 
                                                }
@@ -780,13 +781,13 @@ sub process
                } 
 
                # send a ping out on this channel
-               if ($dxchan->pingint && $t >= $dxchan->pingint + $dxchan->lastping) {
-                       if ($dxchan->nopings <= 0) {
+               if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) {
+                       if ($dxchan->{nopings} <= 0) {
                                $dxchan->disconnect;
                        } else {
                                addping($main::mycall, $dxchan->call);
-                               $dxchan->nopings($dxchan->nopings - 1);
-                               $dxchan->lastping($t);
+                               $dxchan->{nopings} -= 1;
+                               $dxchan->{lastping} = $t;
                        }
                }
        }
index 956957e8260f1218f8eebeacd677b76795f98ef4..dff27088008038b2a53a5dc877782e485d147a7f 100644 (file)
@@ -363,7 +363,10 @@ sub wanttalk
 
 sub wantlogininfo
 {
-       return _want('logininfo', @_);
+       my $self = shift;
+       my $n = shift;
+       $self->{wantlogininfo} = $n if $n;
+       return exists $self->{wantlogininfo} ? $self->{wantlogininfo} : 0;
 }
 
 1;