[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r12015: Backport: "if (!router_get_trusted_dirservers())" is a bad t (in tor/branches/tor-0_1_2-patches: . src/or)
Author: nickm
Date: 2007-10-18 07:59:39 -0400 (Thu, 18 Oct 2007)
New Revision: 12015
Modified:
tor/branches/tor-0_1_2-patches/
tor/branches/tor-0_1_2-patches/src/or/config.c
tor/branches/tor-0_1_2-patches/src/or/routerlist.c
Log:
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.
Property changes on: tor/branches/tor-0_1_2-patches
___________________________________________________________________
svk:merge ticket from /tor/012 [r15902] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/branches/tor-0_1_2-patches/src/or/config.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/config.c 2007-10-18 11:56:56 UTC (rev 12014)
+++ tor/branches/tor-0_1_2-patches/src/or/config.c 2007-10-18 11:59:39 UTC (rev 12015)
@@ -895,7 +895,7 @@
}
}
} else {
- if (!router_get_trusted_dir_servers())
+ if (!smartlist_len(router_get_trusted_dir_servers()))
add_default_trusted_dirservers();
}
Modified: tor/branches/tor-0_1_2-patches/src/or/routerlist.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/routerlist.c 2007-10-18 11:56:56 UTC (rev 12014)
+++ tor/branches/tor-0_1_2-patches/src/or/routerlist.c 2007-10-18 11:59:39 UTC (rev 12015)
@@ -3894,8 +3894,19 @@
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;