summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorJacob Appelbaum <jacob@appelbaum.net>2009-07-11 18:43:33 -0700
committerJacob Appelbaum <jacob@appelbaum.net>2009-07-13 16:30:42 -0700
commite7576f92dec47ffb48f481b7a92b3fc0c76105eb (patch)
tree166faf0f827cf8d7da58311258c287aeac68447b /src/or/networkstatus.c
parent041a7b989630c846fa087628145920198da001f6 (diff)
downloadtor-e7576f92dec47ffb48f481b7a92b3fc0c76105eb.tar.gz
tor-e7576f92dec47ffb48f481b7a92b3fc0c76105eb.zip
Add support for a new option: FetchDirInfoExtraEarly
This new option will allow clients to download the newest fresh consensus much sooner than they normally would do so, even if they previously set FetchDirInfoEarly. This includes a proper ChangeLog entry and an updated man page.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 573197a53f..df17f49548 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1133,8 +1133,13 @@ update_consensus_networkstatus_fetch_time(time_t now)
/* 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;
- /* But only in the first half-interval after that. */
- dl_interval = interval/2;
+ /* Some clients may need the consensus sooner than others. */
+ if (options->FetchDirInfoExtraEarly) {
+ dl_interval = 60;
+ } else {
+ /* But only in the first half-interval after that. */
+ dl_interval = interval/2;
+ }
} else {
/* We're an ordinary client or a bridge. Give all the caches enough
* time to download the consensus. */