diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-10 08:52:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-10 08:52:19 +0000 |
commit | 0af038fabc668461dcb73ed8d80fe3f0aebc26f8 (patch) | |
tree | 6a5a346c1892b608cb4bc7987c8727c4a44786d6 /src | |
parent | 2e7eb2ae0d5d41e957eefe77435a603773bbb08a (diff) | |
download | gnunet-0af038fabc668461dcb73ed8d80fe3f0aebc26f8.tar.gz gnunet-0af038fabc668461dcb73ed8d80fe3f0aebc26f8.zip |
fix
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 7 |
1 files 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; | |||
97 | * Running average of the observed latency to other peers (round trip). | 97 | * Running average of the observed latency to other peers (round trip). |
98 | * Initialized to 5s as the initial default. | 98 | * Initialized to 5s as the initial default. |
99 | */ | 99 | */ |
100 | struct GNUNET_TIME_Relative GSF_avg_latency = { 5000 }; | 100 | struct GNUNET_TIME_Relative GSF_avg_latency = { 500 }; |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Typical priorities we're seeing from other peers right now. Since | 103 | * Typical priorities we're seeing from other peers right now. Since |
@@ -234,8 +234,9 @@ update_latencies (const struct GNUNET_ATS_Information *atsi, | |||
234 | { | 234 | { |
235 | if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DELAY) | 235 | if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DELAY) |
236 | { | 236 | { |
237 | GSF_avg_latency.rel_value = | 237 | GSF_avg_latency.rel_value = (GSF_avg_latency.rel_value * 31 + |
238 | (GSF_avg_latency.rel_value * 31 + ntohl (atsi[i].value)) / 32; | 238 | GNUNET_MIN (5000, |
239 | ntohl (atsi[i].value))) / 32; | ||
239 | GNUNET_STATISTICS_set (GSF_stats, | 240 | GNUNET_STATISTICS_set (GSF_stats, |
240 | gettext_noop | 241 | gettext_noop |
241 | ("# running average P2P latency (ms)"), | 242 | ("# running average P2P latency (ms)"), |