summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-04-06 06:17:35 +0000
committerRoger Dingledine <arma@torproject.org>2005-04-06 06:17:35 +0000
commit716d9bc99ae876ffc108f1b172f13a9d68eb3d06 (patch)
tree98a19af0cdc2d812d595de153abb88ae49f91adb
parent4453e3794a4630f7da8cde0a0aebaad628986a67 (diff)
downloadtor-716d9bc99ae876ffc108f1b172f13a9d68eb3d06.tar.gz
tor-716d9bc99ae876ffc108f1b172f13a9d68eb3d06.zip
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
-rw-r--r--src/or/routerlist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 58fb0e5721..7a1ad02058 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);