From 0af038fabc668461dcb73ed8d80fe3f0aebc26f8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 10 Nov 2011 08:52:19 +0000 Subject: [PATCH] fix --- src/fs/gnunet-service-fs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index f588ee9c4..daffce444 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -97,7 +97,7 @@ struct GNUNET_LOAD_Value *GSF_rt_entry_lifetime; * Running average of the observed latency to other peers (round trip). * Initialized to 5s as the initial default. */ -struct GNUNET_TIME_Relative GSF_avg_latency = { 5000 }; +struct GNUNET_TIME_Relative GSF_avg_latency = { 500 }; /** * Typical priorities we're seeing from other peers right now. Since @@ -234,8 +234,9 @@ update_latencies (const struct GNUNET_ATS_Information *atsi, { if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DELAY) { - GSF_avg_latency.rel_value = - (GSF_avg_latency.rel_value * 31 + ntohl (atsi[i].value)) / 32; + GSF_avg_latency.rel_value = (GSF_avg_latency.rel_value * 31 + + GNUNET_MIN (5000, + ntohl (atsi[i].value))) / 32; GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# running average P2P latency (ms)"), -- 2.25.1