aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-13 00:09:30 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-13 00:09:30 +0000
commitb7781ea2089639d6ea18d295192f5fed3d6a6bef (patch)
tree9684336448c849487b286a963ccef7ba24669033
parentdba155ecfff1739bc263398a38eb92c10aa643ec (diff)
downloadtor-b7781ea2089639d6ea18d295192f5fed3d6a6bef.tar
tor-b7781ea2089639d6ea18d295192f5fed3d6a6bef.tar.gz
bugfix: we were ignoring the IS_FAST flag in the directory
status, meaning we were willing to pick trivial-bandwidth nodes for "fast" connections. svn:r5992
-rw-r--r--src/or/routerlist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 3151bd7cd..8a341aa13 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -726,15 +726,16 @@ router_is_unreliable(routerinfo_t *router, int need_uptime,
/** Remove from routerlist <b>sl</b> all routers that are not
* sufficiently stable. */
static void
-routerlist_sl_remove_unreliable_routers(smartlist_t *sl,
- int need_uptime, int need_guard)
+routerlist_sl_remove_unreliable_routers(smartlist_t *sl, int need_uptime,
+ int need_capacity, int need_guard)
{
int i;
routerinfo_t *router;
for (i = 0; i < smartlist_len(sl); ++i) {
router = smartlist_get(sl, i);
- if (router_is_unreliable(router, need_uptime, 0, need_guard)) {
+ if (router_is_unreliable(router, need_uptime,
+ need_capacity, need_guard)) {
// log(LOG_DEBUG, "Router '%s' has insufficient uptime; deleting.",
// router->nickname);
smartlist_del(sl, i--);
@@ -838,8 +839,8 @@ router_choose_random_node(const char *preferred,
smartlist_subtract(sl,excludednodes);
if (excludedsmartlist)
smartlist_subtract(sl,excludedsmartlist);
- if (need_uptime || need_guard)
- routerlist_sl_remove_unreliable_routers(sl, need_uptime, need_guard);
+ routerlist_sl_remove_unreliable_routers(sl, need_uptime,
+ need_capacity, need_guard);
if (need_capacity)
choice = routerlist_sl_choose_by_bandwidth(sl);
else