diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-04-26 15:33:08 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-04-26 15:36:17 +0200 |
commit | 6fde2b46d2cc2345ec955b1ed9674a777e5e8716 (patch) | |
tree | f48d5a36acc42884a5acf60c1da7eff517e0ed5a /src | |
parent | f3b58dfa53d87656f558a97bc28a333bdea06017 (diff) | |
download | tor-6fde2b46d2cc2345ec955b1ed9674a777e5e8716.tar tor-6fde2b46d2cc2345ec955b1ed9674a777e5e8716.tar.gz |
Fix more of bug 2704
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/rephist.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |