diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-21 06:28:59 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-21 06:28:59 +0000 |
commit | e2dc45a2e1f12bb19b7ce33fb71042f5473d79d2 (patch) | |
tree | 02fd0de06ba032bf9561928a750444d0df2f5425 /src/or/router.c | |
parent | 9ebf86bb668ac7672cf09d55ec9b5756105f95ae (diff) | |
download | tor-e2dc45a2e1f12bb19b7ce33fb71042f5473d79d2.tar.gz tor-e2dc45a2e1f12bb19b7ce33fb71042f5473d79d2.zip |
some more refactoring
svn:r12897
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/or/router.c b/src/or/router.c index 2cacb5f031..aded6e77c6 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -823,16 +823,20 @@ authdir_mode_v3(or_options_t *options) { return authdir_mode(options) && options->V3AuthoritativeDir != 0; } +static int +authdir_mode_any_main(or_options_t *options) +{ + return options->V1AuthoritativeDir || + options->V2AuthoritativeDir || + options->V3AuthoritativeDir; +} /** Return true if we believe ourselves to be any kind of * authoritative directory beyond just a hidserv authority. */ int authdir_mode_any_nonhidserv(or_options_t *options) { - return authdir_mode(options) && - (options->BridgeAuthoritativeDir || - options->V1AuthoritativeDir || - options->V2AuthoritativeDir || - options->V3AuthoritativeDir); + return options->BridgeAuthoritativeDir || + authdir_mode_any_main(options); } /** Return true iff we are an authoritative directory server that is * authoritative about receiving and serving descriptors of type @@ -843,9 +847,7 @@ 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); + return authdir_mode_any_main(options); else if (purpose == ROUTER_PURPOSE_BRIDGE) return (options->BridgeAuthoritativeDir); else |