diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/directory.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 18 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index f782feca2e..e03506a4f4 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -209,7 +209,7 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, } if (!rs) { /* anybody with a non-zero dirport will do */ - rs = router_pick_directory_server(1, 1, type==V2_AUTHORITY, + rs = router_pick_directory_server(1, 1, type, retry_if_no_servers); if (!rs) { const char *which; @@ -239,7 +239,7 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, retry_if_no_servers); } else { /* anybody with a non-zero dirport will do. Disregard firewalls. */ - rs = router_pick_directory_server(1, 0, type == V2_AUTHORITY, + rs = router_pick_directory_server(1, 0, type, retry_if_no_servers); /* If we have any hope of building an indirect conn, we know some router * descriptors. If (rs==NULL), we can't build circuits anyway, so diff --git a/src/or/or.h b/src/or/or.h index e5f9701acf..0a80829481 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3056,7 +3056,7 @@ int router_reload_networkstatus(void); smartlist_t *router_get_trusted_dir_servers(void); routerstatus_t *router_pick_directory_server(int requireother, int fascistfirewall, - int for_v2_directory, + authority_type_t type, int retry_if_no_servers); routerstatus_t *router_pick_trusteddirserver(authority_type_t type, int requireother, diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dfe6cd83eb..e693090989 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -19,9 +19,9 @@ const char routerlist_c_id[] = /* static function prototypes */ static routerstatus_t *router_pick_directory_server_impl(int requireother, - int fascistfirewall, - int prefer_tunnel, - int for_v2_directory); + int fascistfirewall, + int prefer_tunnel, + authority_type_t auth); static routerstatus_t *router_pick_trusteddirserver_impl( authority_type_t type, int requireother, int fascistfirewall, int prefer_tunnel); @@ -511,7 +511,7 @@ router_get_trusted_dir_servers(void) routerstatus_t * router_pick_directory_server(int requireother, int fascistfirewall, - int for_v2_directory, + authority_type_t type, int retry_if_no_servers) { routerstatus_t *choice; @@ -521,7 +521,7 @@ router_pick_directory_server(int requireother, return NULL; choice = router_pick_directory_server_impl(requireother, fascistfirewall, - prefer_tunnel, for_v2_directory); + prefer_tunnel, type); if (choice || !retry_if_no_servers) return choice; @@ -532,7 +532,7 @@ router_pick_directory_server(int requireother, mark_all_trusteddirservers_up(); /* try again */ choice = router_pick_directory_server_impl(requireother, fascistfirewall, - prefer_tunnel, for_v2_directory); + prefer_tunnel, type); if (choice) return choice; @@ -543,7 +543,7 @@ router_pick_directory_server(int requireother, } /* give it one last try */ choice = router_pick_directory_server_impl(requireother, fascistfirewall, - prefer_tunnel, for_v2_directory); + prefer_tunnel, type); return choice; } @@ -611,7 +611,7 @@ router_pick_trusteddirserver(authority_type_t type, */ static routerstatus_t * router_pick_directory_server_impl(int requireother, int fascistfirewall, - int prefer_tunnel, int for_v2_directory) + int prefer_tunnel, authority_type_t type) { routerstatus_t *result; smartlist_t *direct, *tunnel; @@ -642,7 +642,7 @@ router_pick_directory_server_impl(int requireother, int fascistfirewall, if (requireother && router_digest_is_me(status->identity_digest)) continue; is_trusted = router_digest_is_trusted_dir(status->identity_digest); - if (for_v2_directory && !(status->is_v2_dir || is_trusted)) + if ((type & V2_AUTHORITY) && !(status->is_v2_dir || is_trusted)) continue; if (prefer_tunnel && status->version_supports_begindir && |