[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r12897: some more refactoring (tor/trunk/src/or)
Author: arma
Date: 2007-12-21 01:28:59 -0500 (Fri, 21 Dec 2007)
New Revision: 12897
Modified:
tor/trunk/src/or/router.c
Log:
some more refactoring
Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c 2007-12-21 06:08:00 UTC (rev 12896)
+++ tor/trunk/src/or/router.c 2007-12-21 06:28:59 UTC (rev 12897)
@@ -823,16 +823,20 @@
{
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 @@
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