summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-04 18:35:03 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-04 18:35:03 +0000
commitd46b8a3eac7983795756297cca2d69a5aa5e3ad3 (patch)
treeba91853b7e28c2bcd70d014373f98a3126923f93 /src/or/main.c
parent4a03959b10b9db3d47485e7ffb1848e1553cd601 (diff)
downloadtor-d46b8a3eac7983795756297cca2d69a5aa5e3ad3.tar.gz
tor-d46b8a3eac7983795756297cca2d69a5aa5e3ad3.zip
Stop being so aggressive about fetching dir info if your DirPort is
on but your ORPort is off. Add a new config option BridgeRelay that specifies you want to be a bridge relay. Right now the only difference is that it makes you answer begin_dir requests, and it makes you cache dir info, even if your DirPort isn't on. Refactor directory_caches_dir_info() into some more functions. svn:r12668
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index acb7cac3f4..ccf1e1c637 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -952,9 +952,8 @@ run_scheduled_events(time_t now)
* (if we've passed our internal checks). */
if (time_to_fetch_directory < now) {
/* Only caches actually need to fetch directories now. */
- if (directory_caches_dir_info(options) && !authdir_mode_v1(options)) {
- /* XXX020 actually, we should only do this if we want to advertise
- * our dirport. not simply if we configured one. -RD */
+ if (directory_fetches_dir_info_like_mirror(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,
@@ -966,7 +965,7 @@ run_scheduled_events(time_t now)
}
/* Caches need to fetch running_routers; directory clients don't. */
- if (directory_caches_dir_info(options) &&
+ if (directory_fetches_dir_info_like_mirror(options) &&
time_to_fetch_running_routers < now) {
if (!authdir_mode_v1(options) && !should_delay_dir_fetches(options)) {
directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST,