[or-cvs] r10151: move a few more situations over to the authority_type_t bitf (tor/trunk/src/or)
arma at seul.org
arma at seul.org
Thu May 10 04:01:36 UTC 2007
Author: arma
Date: 2007-05-10 00:01:28 -0400 (Thu, 10 May 2007)
New Revision: 10151
Modified:
tor/trunk/src/or/directory.c
tor/trunk/src/or/or.h
tor/trunk/src/or/routerlist.c
Log:
move a few more situations over to the authority_type_t bitfield
Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c 2007-05-09 22:39:49 UTC (rev 10150)
+++ tor/trunk/src/or/directory.c 2007-05-10 04:01:28 UTC (rev 10151)
@@ -209,7 +209,7 @@
}
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 @@
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
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2007-05-09 22:39:49 UTC (rev 10150)
+++ tor/trunk/src/or/or.h 2007-05-10 04:01:28 UTC (rev 10151)
@@ -3056,7 +3056,7 @@
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,
Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c 2007-05-09 22:39:49 UTC (rev 10150)
+++ tor/trunk/src/or/routerlist.c 2007-05-10 04:01:28 UTC (rev 10151)
@@ -19,9 +19,9 @@
/* 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 @@
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 @@
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 @@
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 @@
}
/* 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 @@
*/
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 @@
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 &&
More information about the tor-commits
mailing list