]> dxcluster.org Git - spider.git/commitdiff
Change ping averaging to be like TCP and become a smoothed RTT.
authorminima <minima>
Fri, 7 Sep 2001 19:16:29 +0000 (19:16 +0000)
committerminima <minima>
Fri, 7 Sep 2001 19:16:29 +0000 (19:16 +0000)
Changes
perl/DXProt.pm

diff --git a/Changes b/Changes
index c14763d6d558ab30214afeff6ec8b539d123f361..ea3cff074749058dc523544ab292f523b6e248bb 100644 (file)
--- 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=======================================================================
index c26016ee5048ce9205175a484ae042c3be8b1b31..056402b9501257fc410ba747e72bfb3e49949e9b 100644 (file)
@@ -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}};
                                                                }
                                                        } 
                                                }