From: Mike Perry Date: Tue, 23 Apr 2013 21:43:38 +0000 (-0700) Subject: Bug 8235: Fix scaling adjustments. X-Git-Tag: tor-0.2.4.13-alpha~7^2~12^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2170f89a93a268588a50a7e754157c1f6e03b15f;p=thirdparty%2Ftor.git 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. --- 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();