diff options
author | Roger Dingledine <arma@torproject.org> | 2004-08-17 06:27:32 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-08-17 06:27:32 +0000 |
commit | ee23b7a470c6bc0f5cf08ea2ca13d541626de6b6 (patch) | |
tree | 26f82c4502527df17a58b2faeda78827cba0a549 /src/or/routerlist.c | |
parent | 590cd621f86ba5d454ed35ff411fab4ab48a6c61 (diff) | |
download | tor-ee23b7a470c6bc0f5cf08ea2ca13d541626de6b6.tar.gz tor-ee23b7a470c6bc0f5cf08ea2ca13d541626de6b6.zip |
use unverified routers in the desired positions
svn:r2249
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dc8b0c1054..16cd55dada 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -189,7 +189,9 @@ void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) { /** Add every router from our routerlist that is currently running to * <b>sl</b>. */ -void router_add_running_routers_to_smartlist(smartlist_t *sl) { +static void +router_add_running_routers_to_smartlist(smartlist_t *sl, int allow_unverified) +{ routerinfo_t *router; int i; @@ -198,8 +200,8 @@ void router_add_running_routers_to_smartlist(smartlist_t *sl) { for(i=0;i<smartlist_len(routerlist->routers);i++) { router = smartlist_get(routerlist->routers, i); - /* XXX008 for now, only choose verified routers */ - if(router->is_running && router->is_verified) { + if(router->is_running && + (allow_unverified || router->is_verified)) { if(!clique_mode()) { smartlist_add(sl, router); } else { @@ -289,7 +291,7 @@ routerlist_sl_choose_by_bandwidth(smartlist_t *sl) routerinfo_t *router_choose_random_node(char *preferred, char *excluded, smartlist_t *excludedsmartlist, int preferuptime, int preferbandwidth, - int strict) + int allow_unverified, int strict) { smartlist_t *sl, *excludednodes; routerinfo_t *choice; @@ -312,7 +314,7 @@ routerinfo_t *router_choose_random_node(char *preferred, char *excluded, smartlist_free(sl); if(!choice && !strict) { sl = smartlist_create(); - router_add_running_routers_to_smartlist(sl); + router_add_running_routers_to_smartlist(sl, allow_unverified); smartlist_subtract(sl,excludednodes); if(excludedsmartlist) smartlist_subtract(sl,excludedsmartlist); |