summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-06 12:36:04 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-06 12:36:04 +0000
commitd1aafdc51921b6b7e1634b369f98dfd6b5eb1b99 (patch)
tree2b1a8b33e5a19709cf66ed58af226d7f90ccbfdc
parentec6c131da613adad2ea4936256b7b0dc00b2ca2f (diff)
downloadtor-d1aafdc51921b6b7e1634b369f98dfd6b5eb1b99.tar.gz
tor-d1aafdc51921b6b7e1634b369f98dfd6b5eb1b99.zip
don't fetch or cache running-routers files if there are no v1
authorities svn:r13398
-rw-r--r--src/or/main.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/or/main.c b/src/or/main.c
index e95135529c..1628762249 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -961,26 +961,24 @@ run_scheduled_events(time_t now)
* new running-routers list, and/or force-uploading our descriptor
* (if we've passed our internal checks). */
if (time_to_fetch_directory < now) {
- /* Only caches actually need to fetch directories now. */
+ /* Only caches actually need to fetch v1 directories now. */
if (directory_fetches_dir_info_early(options) &&
- !authdir_mode_v1(options)) {
- if (any_trusted_dir_is_v1_authority() &&
- !should_delay_dir_fetches(options))
- directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR,
- ROUTER_PURPOSE_GENERAL, NULL, 1);
- }
+ !authdir_mode_v1(options) && any_trusted_dir_is_v1_authority() &&
+ !should_delay_dir_fetches(options))
+ directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR,
+ ROUTER_PURPOSE_GENERAL, NULL, 1);
/** How often do we (as a cache) fetch a new V1 directory? */
#define V1_DIR_FETCH_PERIOD (12*60*60)
time_to_fetch_directory = now + V1_DIR_FETCH_PERIOD;
}
/* Caches need to fetch running_routers; directory clients don't. */
- if (directory_fetches_dir_info_early(options) &&
- time_to_fetch_running_routers < now) {
- if (!authdir_mode_v1(options) && !should_delay_dir_fetches(options)) {
+ if (time_to_fetch_running_routers < now) {
+ if (directory_fetches_dir_info_early(options) &&
+ !authdir_mode_v1(options) && any_trusted_dir_is_v1_authority() &&
+ !should_delay_dir_fetches(options))
directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST,
ROUTER_PURPOSE_GENERAL, NULL, 1);
- }
/** How often do we (as a cache) fetch a new V1 runningrouters document? */
#define V1_RUNNINGROUTERS_FETCH_PERIOD (12*60*60)
time_to_fetch_running_routers = now + V1_RUNNINGROUTERS_FETCH_PERIOD;