From 638d9efe6fe3d3c4eec08d5e985fce4dd760423b Mon Sep 17 00:00:00 2001 From: djk Date: Sun, 21 Nov 1999 17:19:28 +0000 Subject: [PATCH] fixed the default fo set/login to off not on --- perl/DXProt.pm | 31 ++++++++++++++++--------------- perl/DXUser.pm | 5 ++++- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/perl/DXProt.pm b/perl/DXProt.pm index e65cad70..710a3dbf 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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; } } } diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 956957e8..dff27088 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -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; -- 2.43.0