diff options
author | Roger Dingledine <arma@torproject.org> | 2005-04-06 06:17:35 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-04-06 06:17:35 +0000 |
commit | 716d9bc99ae876ffc108f1b172f13a9d68eb3d06 (patch) | |
tree | 98a19af0cdc2d812d595de153abb88ae49f91adb /src | |
parent | 4453e3794a4630f7da8cde0a0aebaad628986a67 (diff) | |
download | tor-716d9bc99ae876ffc108f1b172f13a9d68eb3d06.tar tor-716d9bc99ae876ffc108f1b172f13a9d68eb3d06.tar.gz |
when using preferred entry or exit nodes, ignore whether
the circuit wants uptime or capacity. they asked for the
nodes, they get the nodes.
svn:r4025
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerlist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 58fb0e572..7a1ad0205 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -502,20 +502,25 @@ routerinfo_t *router_choose_random_node(const char *preferred, excludednodes = smartlist_create(); add_nickname_list_to_smartlist(excludednodes,excluded,0); - /* try the preferred nodes first */ + /* Try the preferred nodes first. Ignore need_uptime and need_capacity, + * since the user explicitly asked for these nodes. */ sl = smartlist_create(); add_nickname_list_to_smartlist(sl,preferred,1); smartlist_subtract(sl,excludednodes); if (excludedsmartlist) smartlist_subtract(sl,excludedsmartlist); +#if 0 if (need_uptime) routerlist_sl_remove_unreliable_routers(sl); if (need_capacity) choice = routerlist_sl_choose_by_bandwidth(sl); else - choice = smartlist_choose(sl); +#endif + choice = smartlist_choose(sl); smartlist_free(sl); if (!choice && !strict) { + /* Then give up on our preferred choices: any node + * will do that has the required attributes. */ sl = smartlist_create(); router_add_running_routers_to_smartlist(sl, allow_unverified, need_uptime, need_capacity); |