projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pump up eph dups everytime they re-occur and increase life to 180 secs
[spider.git]
/
perl
/
DXProt.pm
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index 056402b9501257fc410ba747e72bfb3e49949e9b..201013a0c1bd034b9e7abcbac159756dd7a8031e 100644
(file)
--- a/
perl/DXProt.pm
+++ b/
perl/DXProt.pm
@@
-1039,19
+1039,27
@@
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
+ if ($tochan->is_arcluster && $t > $tochan->{pingint} && $t < 2 * $tochan->{pingint} ) {
+ $t -= $tochan->{pingint};
}
}
+
+ # 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
}
}
}
}
}
}
@@
-1908,12
+1916,13
@@
sub in_filter_route
sub eph_dup
{
my $s = shift;
sub eph_dup
{
my $s = shift;
+ my $r;
# chop the end off
$s =~ s/\^H\d\d?\^?\~?$//;
# chop the end off
$s =~ s/\^H\d\d?\^?\~?$//;
- return 1 if exists $eph{$s};
+ $r = 1 if exists $eph{$s}; # pump up the dup if it keeps circulating
$eph{$s} = $main::systime;
$eph{$s} = $main::systime;
- return
undef
;
+ return
$r
;
}
sub eph_del_regex
}
sub eph_del_regex
@@
-1932,7
+1941,7
@@
sub eph_clean
my ($key, $val);
while (($key, $val) = each %eph) {
my ($key, $val);
while (($key, $val) = each %eph) {
- if ($main::systime - $val >
9
0) {
+ if ($main::systime - $val >
18
0) {
delete $eph{$key};
}
}
delete $eph{$key};
}
}