]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't sometimes undercount bw average
authorSebastian Hahn <sebastian@torproject.org>
Tue, 19 Apr 2011 15:12:27 +0000 (17:12 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 19 Apr 2011 19:38:10 +0000 (15:38 -0400)
This fixes the first part of bug 2704. It should occur only rarely when
no bw maxima are known. Bugfix on 0.2.2.23-alpha. Fixes bug 2704.

changes/bug2704_part1 [new file with mode: 0644]
src/or/rephist.c

diff --git a/changes/bug2704_part1 b/changes/bug2704_part1
new file mode 100644 (file)
index 0000000..eaf2281
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix an issue causing calculation of Tor's average bandwidth as saved
+      in the state file to be 10 times smaller than it should be. Fixes the
+      first part of bug 2704, bugfix on tor-0.2.2.23-alpha.
+
index 9b7eefecf248b91651816e5a9062906111521101..6034bbcb2bad12d0cca4aef2cb364ffd62d840a2 100644 (file)
@@ -1673,7 +1673,7 @@ rep_hist_load_bwhist_state_section(bw_array_t *b,
           mv *= NUM_SECS_ROLLING_MEASURE;
         } else {
           /* No maxima known; guess average rate to be conservative. */
-          mv = v / s_interval;
+          mv = (v / s_interval) * NUM_SECS_ROLLING_MEASURE;
         }
         if (!ok) {
           retval = -1;