diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2013-04-23 14:43:38 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-04-24 22:03:02 -0400 |
commit | 2170f89a93a268588a50a7e754157c1f6e03b15f (patch) | |
tree | c1b30d5195f795c2c8dd92dcf7e78fca338aabcb | |
parent | b933360ee848873db6c051eabe5aecd01b3f67a3 (diff) | |
download | tor-2170f89a93a268588a50a7e754157c1f6e03b15f.tar.gz tor-2170f89a93a268588a50a7e754157c1f6e03b15f.zip |
Bug 8235: Fix scaling adjustments.
We need to subtract both the current built circuits *and* the attempted
circuits from the attempt count during scaling, since *both* have already been
counted there.
-rw-r--r-- | src/or/circuitbuild.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 31242f6c14..43d2ffe4db 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2491,7 +2491,7 @@ pathbias_scale_close_rates(entry_guard_t *guard) /* Verify that the counts are sane before and after scaling */ int counts_are_sane = (guard->circ_attempts >= guard->circ_successes); - guard->circ_attempts -= opened_attempts; + guard->circ_attempts -= (opened_attempts+opened_built); guard->circ_successes -= opened_built; guard->circ_attempts *= scale_ratio; @@ -2501,7 +2501,7 @@ pathbias_scale_close_rates(entry_guard_t *guard) guard->collapsed_circuits *= scale_ratio; guard->unusable_circuits *= scale_ratio; - guard->circ_attempts += opened_attempts; + guard->circ_attempts += (opened_attempts+opened_built); guard->circ_successes += opened_built; entry_guards_changed(); |