projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a39cb7
)
fixed the default fo set/login to off not on
author
djk
<djk>
Sun, 21 Nov 1999 17:19:28 +0000
(17:19 +0000)
committer
djk
<djk>
Sun, 21 Nov 1999 17:19:28 +0000
(17:19 +0000)
perl/DXProt.pm
patch
|
blob
|
history
perl/DXUser.pm
patch
|
blob
|
history
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index e65cad70a799ddc53af94e0fb45279ca2745d201..710a3dbf84129a4b0405fc92597c8ff2cd7e2161 100644
(file)
--- 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;
# 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());
# 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;
} 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);
}
$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 $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) {
$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;
my $st;
- for (@{$tochan->
pingtime
}) {
+ for (@{$tochan->
{pingtime}
}) {
$st += $_;
}
$st += $_;
}
- $tochan->{pingave} = $st / @{$tochan->
pingtime
};
+ $tochan->{pingave} = $st / @{$tochan->
{pingtime}
};
}
}
}
}
}
}
@@
-780,13
+781,13
@@
sub process
}
# send a ping out on this channel
}
# 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->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 956957e8260f1218f8eebeacd677b76795f98ef4..dff27088008038b2a53a5dc877782e485d147a7f 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-363,7
+363,10
@@
sub wanttalk
sub wantlogininfo
{
sub wantlogininfo
{
- return _want('logininfo', @_);
+ my $self = shift;
+ my $n = shift;
+ $self->{wantlogininfo} = $n if $n;
+ return exists $self->{wantlogininfo} ? $self->{wantlogininfo} : 0;
}
1;
}
1;