mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Don't sometimes undercount bw average
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.
This commit is contained in:
committed by
Nick Mathewson
parent
5cc322e547
commit
13c3884ff6
@@ -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.
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user