mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
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.
This commit is contained in:
parent
f3b58dfa53
commit
6fde2b46d2
2 changed files with 7 additions and 1 deletions
5
changes/bug2704
Normal file
5
changes/bug2704
Normal file
|
@ -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.
|
||||||
|
|
|
@ -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));
|
tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->total_in_period & ~0x3ff));
|
||||||
smartlist_add(*s_values, cp);
|
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);
|
smartlist_add(*s_maxima, cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue