From: minima Date: Fri, 7 Sep 2001 19:16:29 +0000 (+0000) Subject: Change ping averaging to be like TCP and become a smoothed RTT. X-Git-Tag: R_1_48~48 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=363839f98405239478bbe5a85efad1d679a1c722;p=spider.git Change ping averaging to be like TCP and become a smoothed RTT. --- diff --git a/Changes b/Changes index c14763d6..ea3cff07 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ 06Sep01======================================================================= 1. prevent nodes appearing as users from incoming PC16s +2. Change ping averaging to be like TCP and become a smoothed RTT. 04Sep01======================================================================= 1. add delete/user command 03Sep01======================================================================= diff --git a/perl/DXProt.pm b/perl/DXProt.pm index c26016ee..056402b9 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1046,7 +1046,12 @@ sub normal for (@{$tochan->{pingtime}}) { $st += $_; } - $tochan->{pingave} = $st / @{$tochan->{pingtime}}; + if (@{$tochan->{pingtime}} == 1) { + $tochan->{pingave} = $t; + } else { + $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 8); + } +# $tochan->{pingave} = $st / @{$tochan->{pingtime}}; } } }