From: Mike Perry Date: Fri, 2 Nov 2012 19:36:08 +0000 (-0700) Subject: Fix an assert crash and an incorrectly placed return. X-Git-Tag: tor-0.2.4.8-alpha~18^2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef1b830ef8d751172ebe577a3e8a754c89225394;p=thirdparty%2Ftor.git Fix an assert crash and an incorrectly placed return. --- diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index feb8e9cddc..eda36d3c44 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1100,7 +1100,7 @@ pathbias_get_mult_factor(const or_options_t *options) else return networkstatus_get_param(NULL, "pb_multfactor", DFLT_PATH_BIAS_MULT_FACTOR, 1, - pathbias_get_scale_factor(options)-1); + pathbias_get_scale_factor(options)); } /** @@ -1398,6 +1398,7 @@ entry_guard_inc_first_hop_count(entry_guard_t *guard) (long)circ_times.close_ms/1000); guard->path_bias_disabled = 1; guard->bad_since = approx_time(); + return -1; } } else if (!guard->path_bias_extreme) { guard->path_bias_extreme = 1; @@ -1411,7 +1412,6 @@ entry_guard_inc_first_hop_count(entry_guard_t *guard) guard->circuit_successes, guard->first_hops, guard->timeouts, (long)circ_times.close_ms/1000); } - return -1; } else if (guard->circuit_successes/((double)guard->first_hops) < pathbias_get_warn_rate(options)) { if (!guard->path_bias_warned) {