summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-21 06:33:02 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-21 06:33:02 +0000
commit7b60d6c526fd1a7e7d83e1fb2ab27ab0a3d8890b (patch)
tree0fafdf713a1ab6878c57850fca912f93f80a998c
parente2dc45a2e1f12bb19b7ce33fb71042f5473d79d2 (diff)
downloadtor-7b60d6c526fd1a7e7d83e1fb2ab27ab0a3d8890b.tar.gz
tor-7b60d6c526fd1a7e7d83e1fb2ab27ab0a3d8890b.zip
Directory authorities should only automatically download Extra Info
documents if they're v1, v2, or v3 authorities. svn:r12898
-rw-r--r--ChangeLog2
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/or.h4
-rw-r--r--src/or/router.c3
4 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 4efa274f25..f28eb564ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,6 +95,8 @@ Changes in version 0.2.0.13-alpha - 2007-12-21
- Only Tors that want to mirror the v2 directory info should
create the "cached-status" directory in their datadir. All Tors
used to create it. Bugfix on 0.1.2.x.
+ - Directory authorities should only automatically download Extra Info
+ documents if they're v1, v2, or v3 authorities.
o Minor features:
- On USR1, when dmalloc is in use, log the top 10 memory
diff --git a/src/or/config.c b/src/or/config.c
index 6d9ab48c3c..0a0c014377 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2785,7 +2785,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
"UseEntryGuards. Disabling.");
options->UseEntryGuards = 0;
}
- if (!options->DownloadExtraInfo) {
+ if (!options->DownloadExtraInfo && authdir_mode_any_main(options)) {
log_info(LD_CONFIG, "Authoritative directories always try to download "
"extra-info documents. Setting DownloadExtraInfo.");
options->DownloadExtraInfo = 1;
diff --git a/src/or/or.h b/src/or/or.h
index 70a088a6a4..0c8fa593b3 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3732,11 +3732,13 @@ int authdir_mode(or_options_t *options);
int authdir_mode_v1(or_options_t *options);
int authdir_mode_v2(or_options_t *options);
int authdir_mode_v3(or_options_t *options);
+int authdir_mode_any_main(or_options_t *options);
+int authdir_mode_any_nonhidserv(or_options_t *options);
int authdir_mode_handles_descs(or_options_t *options, int purpose);
int authdir_mode_publishes_statuses(or_options_t *options);
int authdir_mode_tests_reachability(or_options_t *options);
int authdir_mode_bridge(or_options_t *options);
-int authdir_mode_any_nonhidserv(or_options_t *options);
+
int clique_mode(or_options_t *options);
int server_mode(or_options_t *options);
int advertised_server_mode(void);
diff --git a/src/or/router.c b/src/or/router.c
index aded6e77c6..a64320f11b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -823,7 +823,8 @@ authdir_mode_v3(or_options_t *options)
{
return authdir_mode(options) && options->V3AuthoritativeDir != 0;
}
-static int
+/** Return true iff we are a v1, v2, or v3 directory authority. */
+int
authdir_mode_any_main(or_options_t *options)
{
return options->V1AuthoritativeDir ||