diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-04 18:35:03 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-04 18:35:03 +0000 |
commit | d46b8a3eac7983795756297cca2d69a5aa5e3ad3 (patch) | |
tree | ba91853b7e28c2bcd70d014373f98a3126923f93 /src/or/networkstatus.c | |
parent | 4a03959b10b9db3d47485e7ffb1848e1553cd601 (diff) | |
download | tor-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/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 6472576f52..7051e82158 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1051,7 +1051,7 @@ update_consensus_networkstatus_fetch_time(time_t now) long dl_interval; long interval = c->fresh_until - c->valid_after; time_t start; - if (directory_caches_dir_info(options)) { + if (directory_fetches_dir_info_like_mirror(options)) { /* We want to cache the next one at some point after this one * is no longer fresh... */ start = c->fresh_until + CONSENSUS_MIN_SECONDS_BEFORE_CACHING; @@ -1062,6 +1062,8 @@ update_consensus_networkstatus_fetch_time(time_t now) start = c->fresh_until + (interval*3)/4; /* But download the next one before this one is expired. */ dl_interval = ((c->valid_until - start) * 7 )/ 8; + /* XXX020 do something different if + * directory_fetches_dir_info_like_bridge_user() */ } if (dl_interval < 1) dl_interval = 1; @@ -1110,7 +1112,7 @@ update_networkstatus_downloads(time_t now) or_options_t *options = get_options(); if (should_delay_dir_fetches(options)) return; - if (directory_caches_dir_info(options)) + if (directory_fetches_dir_info_like_mirror(options)) update_v2_networkstatus_cache_downloads(now); update_consensus_networkstatus_downloads(now); update_certificate_downloads(now); |