diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-18 11:59:39 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-18 11:59:39 +0000 |
commit | 022b0871481729f552a715a49ee733658c17b5ec (patch) | |
tree | e9aa45a87d3869551fa7b39374d331269e6713d3 | |
parent | b3c6fd7fc6653e9d9507fd2663b743228e3045fd (diff) | |
download | tor-022b0871481729f552a715a49ee733658c17b5ec.tar.gz tor-022b0871481729f552a715a49ee733658c17b5ec.zip |
r15902@catbus: nickm | 2007-10-18 07:53:26 -0400
Backport: "if (!router_get_trusted_dirservers())" is a bad test: router_get_trusted_dirservers() always returns a list. Instead, check for whether the list is empty.
svn:r12015
-rw-r--r-- | src/or/config.c | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 2be061bcf4..773e8adb5c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -895,7 +895,7 @@ options_act(or_options_t *old_options) } } } else { - if (!router_get_trusted_dir_servers()) + if (!smartlist_len(router_get_trusted_dir_servers())) add_default_trusted_dirservers(); } diff --git a/src/or/routerlist.c b/src/or/routerlist.c index bf8ed69bf5..9ef41cefb4 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3894,8 +3894,19 @@ routers_update_status_from_networkstatus(smartlist_t *routers, rs = router_get_combined_status_by_digest(digest); ds = router_get_trusteddirserver_by_digest(digest); - if (!rs) + if (!rs) { + if (!namingdir) + router->is_named = 0; + if (!authdir) { + if (router->purpose == ROUTER_PURPOSE_GENERAL) { + router->is_valid = router->is_running = + router->is_fast = router->is_stable = + router->is_possible_guard = router->is_exit = + router->is_bad_exit = 0; + } + } continue; + } if (!namingdir) router->is_named = rs->status.is_named; |