projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1478505
)
added some diddling to cope with ab5k not always returning a ping
author
minima
<minima>
Fri, 7 Sep 2001 21:07:10 +0000
(21:07 +0000)
committer
minima
<minima>
Fri, 7 Sep 2001 21:07:10 +0000
(21:07 +0000)
perl/DXProt.pm
patch
|
blob
|
history
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index 056402b9501257fc410ba747e72bfb3e49949e9b..023daa334e9e03b9545a0d0b0598d6f7adab700e 100644
(file)
--- a/
perl/DXProt.pm
+++ b/
perl/DXProt.pm
@@
-1039,19
+1039,28
@@
sub normal
$dxchan->send($dxchan->msg('pingi', $from, $s, $ave))
} elsif ($dxchan->is_node) {
if ($tochan) {
$dxchan->send($dxchan->msg('pingi', $from, $s, $ave))
} elsif ($dxchan->is_node) {
if ($tochan) {
- $tochan->{nopings} = $tochan->user->nopings || 2; # pump up the timer
+ my $nopings = $tochan->user->nopings || 2;
push @{$tochan->{pingtime}}, $t;
shift @{$tochan->{pingtime}} if @{$tochan->{pingtime}} > 6;
push @{$tochan->{pingtime}}, $t;
shift @{$tochan->{pingtime}} if @{$tochan->{pingtime}} > 6;
- my $st;
- for (@{$tochan->{pingtime}}) {
- $st += $_;
+
+ # cope with a missed ping, this means you must set the pingint large enough
+ my $miss = ($nopings-$tochan->{nopings}) * $tochan->{pingint};
+ if ($tochan->is_arcluster && $t > $miss && $t < $miss + $tochan->{nopings} ) {
+ $t -= $miss;
}
}
+
+ # calc smoothed RTT a la TCP
if (@{$tochan->{pingtime}} == 1) {
$tochan->{pingave} = $t;
} else {
$tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 8);
}
if (@{$tochan->{pingtime}} == 1) {
$tochan->{pingave} = $t;
} else {
$tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 8);
}
+# my $st;
+# for (@{$tochan->{pingtime}}) {
+# $st += $_;
+# }
# $tochan->{pingave} = $st / @{$tochan->{pingtime}};
# $tochan->{pingave} = $st / @{$tochan->{pingtime}};
+ $tochan->{nopings} = $nopings; # pump up the timer
}
}
}
}
}
}