aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-18 11:20:15 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-18 11:20:15 +0000
commitb500104cbe48d072a7f3ef9135263b054fc63d76 (patch)
treee61da657218c18c232029fac9bcf02684c72f6ba /src/or/routerlist.c
parentd6c09c054aa0154a6d4cd12225f0714d6330592f (diff)
downloadtor-b500104cbe48d072a7f3ef9135263b054fc63d76.tar
tor-b500104cbe48d072a7f3ef9135263b054fc63d76.tar.gz
tolerate old 0.0.7 clients that demand a certain ip:port for a router
even though it's moved on to another one. also reduce some log verbosity. svn:r2288
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index d24286a0b..cda2ef5fd 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -152,7 +152,9 @@ int all_directory_servers_down(void) {
* nicknames in <b>list</b> name routers in our routerlist that are
* currently running. Add the routerinfos for those routers to <b>sl</b>.
*/
-void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) {
+void
+add_nickname_list_to_smartlist(smartlist_t *sl, const char *list, int warn_if_down)
+{
const char *start,*end;
char nick[MAX_HEX_NICKNAME_LEN+1];
routerinfo_t *router;
@@ -177,7 +179,8 @@ void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) {
if (router->is_running)
smartlist_add(sl,router);
else
- log_fn(LOG_WARN,"Nickname list includes '%s' which is known but down.",nick);
+ log_fn(warn_if_down ? LOG_WARN : LOG_DEBUG,
+ "Nickname list includes '%s' which is known but down.",nick);
} else
log_fn(has_fetched_directory ? LOG_WARN : LOG_INFO,
"Nickname list includes '%s' which isn't a known router.",nick);
@@ -284,7 +287,7 @@ routerlist_sl_choose_by_bandwidth(smartlist_t *sl)
SMARTLIST_FOREACH(bandwidths, uint32_t*, p, tor_free(p));
smartlist_free(bandwidths);
router = smartlist_get(sl, i);
- log_fn(LOG_INFO,"Picked %s.", router->nickname);
+// log_fn(LOG_INFO,"Picked %s.", router->nickname);
return router;
}
@@ -304,11 +307,11 @@ routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
routerinfo_t *choice;
excludednodes = smartlist_create();
- add_nickname_list_to_smartlist(excludednodes,excluded);
+ add_nickname_list_to_smartlist(excludednodes,excluded,0);
/* try the preferred nodes first */
sl = smartlist_create();
- add_nickname_list_to_smartlist(sl,preferred);
+ add_nickname_list_to_smartlist(sl,preferred,1);
smartlist_subtract(sl,excludednodes);
if(excludedsmartlist)
smartlist_subtract(sl,excludedsmartlist);