From fb4b804c2c244a5575f6ce2d09eb2497ab0250e1 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sat, 7 Aug 2004 09:01:56 +0000 Subject: [PATCH] Don't warn about being unverified if you're not in the running-routers list at all. svn:r2193 --- src/or/or.h | 6 +++--- src/or/routerlist.c | 13 ++++++++----- src/or/routerparse.c | 8 ++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/or/or.h b/src/or/or.h index 995b5e5a7a..f2bd9a17cf 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1400,9 +1400,9 @@ int router_exit_policy_rejects_all(routerinfo_t *router); void running_routers_free(running_routers_t *rr); void routerlist_update_from_runningrouters(routerlist_t *list, running_routers_t *rr); -void router_update_status_from_smartlist(routerinfo_t *r, - time_t list_time, - smartlist_t *running_list); +int router_update_status_from_smartlist(routerinfo_t *r, + time_t list_time, + smartlist_t *running_list); /********************************* routerparse.c ************************/ diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 798353b5e5..1b53c4a365 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -825,10 +825,12 @@ void routerlist_update_from_runningrouters(routerlist_t *list, *
  • $hexdigest -- router is running and unverified. *
  • !$hexdigest -- router is not-running and unverified. * + * + * Return 1 if we found router in running_list, else return 0. */ -void router_update_status_from_smartlist(routerinfo_t *router, - time_t list_time, - smartlist_t *running_list) +int router_update_status_from_smartlist(routerinfo_t *router, + time_t list_time, + smartlist_t *running_list) { int n_names, i, running, approved; const char *name; @@ -863,7 +865,7 @@ void router_update_status_from_smartlist(routerinfo_t *router, router->is_running = 1; } router->is_verified = (name[0] != '$'); - return; + return 1; } } else { /* *name == '!' */ name++; @@ -873,10 +875,11 @@ void router_update_status_from_smartlist(routerinfo_t *router, router->is_running = 0; } router->is_verified = (name[0] != '$'); - return; + return 1; } } } + return 0; } /* diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 01641625b4..ace10b24e0 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -393,7 +393,7 @@ router_parse_routerlist_from_directory(const char *str, for (i=0; in_args; ++i) { smartlist_add(good_nickname_list, tok->args[i]); } - tok->n_args = 0; /* Don't free the strings in good_nickname_lst yet. */ + tok->n_args = 0; /* Don't free the strings in good_nickname_list yet. */ /* Read the router list from s, advancing s up past the end of the last * router. */ @@ -416,9 +416,9 @@ router_parse_routerlist_from_directory(const char *str, static int have_warned_about_unverified_status = 0; routerinfo_t *me = router_get_my_routerinfo(); if(me) { - router_update_status_from_smartlist(me, published_on, - good_nickname_list); - if(me->is_verified == 0 && !have_warned_about_unverified_status) { + if(router_update_status_from_smartlist(me, published_on, + good_nickname_list)==1 && + me->is_verified == 0 && !have_warned_about_unverified_status) { log_fn(LOG_WARN,"Dirserver %s lists your server as unverified. Please consider sending your identity fingerprint to the tor-ops.", dirnickname); have_warned_about_unverified_status = 1; }