aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-11-02 12:36:08 -0700
committerMike Perry <mikeperry-git@fscked.org>2012-12-07 15:28:37 -0800
commitef1b830ef8d751172ebe577a3e8a754c89225394 (patch)
tree37cd41ec7568fadf078fda68166e67d49f1e14eb /src/or/circuitbuild.c
parentf215d1910517ad3d6bb0b7ba5280f9fa1a59c297 (diff)
downloadtor-ef1b830ef8d751172ebe577a3e8a754c89225394.tar
tor-ef1b830ef8d751172ebe577a3e8a754c89225394.tar.gz
Fix an assert crash and an incorrectly placed return.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index feb8e9cdd..eda36d3c4 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) {