]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix more of bug 2704
authorSebastian Hahn <sebastian@torproject.org>
Tue, 26 Apr 2011 13:33:08 +0000 (15:33 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Tue, 26 Apr 2011 13:36:17 +0000 (15:36 +0200)
The last entry of the *Maxima values in the state file was inflated by a
factor of NUM_SECS_ROLLING_MEASURE (currently 10). This could lead to
a wrong maximum value propagating through the state file history.

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

diff --git a/changes/bug2704 b/changes/bug2704
new file mode 100644 (file)
index 0000000..821b38b
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes:
+    - When writing our maximum bw for the current interval to the state
+      file, don't wrongly inflate that value by a factor of 10 anymore.
+      Fixes more of bug 2704.
+
index fb091d5adf053c4f1f98fa625847ac33a2d23405..9146fce7f3ed792906b194e2a179b4cc28ef01a1 100644 (file)
@@ -1614,7 +1614,8 @@ rep_hist_update_bwhist_state_section(or_state_t *state,
   }
   tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->total_in_period & ~0x3ff));
   smartlist_add(*s_values, cp);
-  tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->max_total & ~0x3ff));
+  maxval = b->max_total / NUM_SECS_ROLLING_MEASURE;
+  tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(maxval & ~0x3ff));
   smartlist_add(*s_maxima, cp);
 }