From 363839f98405239478bbe5a85efad1d679a1c722 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 7 Sep 2001 19:16:29 +0000 Subject: [PATCH] Change ping averaging to be like TCP and become a smoothed RTT. --- Changes | 1 + perl/DXProt.pm | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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}}; } } } -- 2.43.0