aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-26 11:07:48 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-26 11:07:48 -0400
commitf083347adf40164aac3b77d118ec372c89178d5a (patch)
treeb7126fe574a642d72f3407760b87a59c26059942
parent4c789ec08c8d52c3aab3ab775a86fe2350d584b5 (diff)
parent6fde2b46d2cc2345ec955b1ed9674a777e5e8716 (diff)
downloadtor-f083347adf40164aac3b77d118ec372c89178d5a.tar
tor-f083347adf40164aac3b77d118ec372c89178d5a.tar.gz
Merge remote-tracking branch 'sebastian/bug2704' into maint-0.2.2
-rw-r--r--changes/bug27045
-rw-r--r--src/or/rephist.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/changes/bug2704 b/changes/bug2704
new file mode 100644
index 000000000..821b38bc0
--- /dev/null
+++ b/changes/bug2704
@@ -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.
+
diff --git a/src/or/rephist.c b/src/or/rephist.c
index fb091d5ad..9146fce7f 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -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);
}