diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-12-18 23:45:24 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-12-18 23:45:24 +0000 |
commit | d07122ba4741897967d110b10ed8ca0441cc6397 (patch) | |
tree | 9622be8f97b48243a4dff53e380fcc68f73fe523 /src/or/router.c | |
parent | 076097281dde078149ed789cf3df0ef6ecce815d (diff) | |
download | tor-d07122ba4741897967d110b10ed8ca0441cc6397.tar.gz tor-d07122ba4741897967d110b10ed8ca0441cc6397.zip |
r17246@catbus: nickm | 2007-12-18 18:45:17 -0500
Fix some xxx020 items.
svn:r12864
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/or/router.c b/src/or/router.c index 779e54e357..2cacb5f031 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -834,13 +834,22 @@ authdir_mode_any_nonhidserv(or_options_t *options) options->V2AuthoritativeDir || options->V3AuthoritativeDir); } -/** Return true iff we are an authoritative directory server that - * is willing to receive or serve descriptors on its dirport. - */ +/** Return true iff we are an authoritative directory server that is + * authoritative about receiving and serving descriptors of type + * <b>purpose</b> its dirport. Use -1 for "any purpose". */ int -authdir_mode_handles_descs(or_options_t *options) -{ - return authdir_mode_any_nonhidserv(options); +authdir_mode_handles_descs(or_options_t *options, int purpose) +{ + if (purpose < 0) + return authdir_mode_any_nonhidserv(options); + else if (purpose == ROUTER_PURPOSE_GENERAL) + return (options->V1AuthoritativeDir || + options->V2AuthoritativeDir || + options->V3AuthoritativeDir); + else if (purpose == ROUTER_PURPOSE_BRIDGE) + return (options->BridgeAuthoritativeDir); + else + return 0; } /** Return true iff we are an authoritative directory server that * publishes its own network statuses. @@ -858,7 +867,7 @@ authdir_mode_publishes_statuses(or_options_t *options) int authdir_mode_tests_reachability(or_options_t *options) { - return authdir_mode_handles_descs(options); + return authdir_mode_handles_descs(options, -1); } /** Return true iff we believe ourselves to be a bridge authoritative * directory server. |