diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-18 10:51:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-18 10:52:58 -0400 |
commit | d14127eb7adfb92b1790f0aaa65089cfb6c71094 (patch) | |
tree | 7fe0729ebea653b876c6eaeb0fa0844c81fe56e2 /src/or/networkstatus.c | |
parent | bb175dac9641f5678875904bb289a1c03054f22c (diff) | |
download | tor-d14127eb7adfb92b1790f0aaa65089cfb6c71094.tar.gz tor-d14127eb7adfb92b1790f0aaa65089cfb6c71094.zip |
Use the DL_SCHED_CONSENSUS schedule for consensuses.
Fixes bug 11679; bugfix on 0.2.2.6-alpha
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 95eb32035b..c7bed9b059 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -83,7 +83,11 @@ static consensus_waiting_for_certs_t * before the current consensus becomes invalid. */ static time_t time_to_download_next_consensus[N_CONSENSUS_FLAVORS]; /** Download status for the current consensus networkstatus. */ -static download_status_t consensus_dl_status[N_CONSENSUS_FLAVORS]; +static download_status_t consensus_dl_status[N_CONSENSUS_FLAVORS] = + { + { 0, 0, DL_SCHED_CONSENSUS }, + { 0, 0, DL_SCHED_CONSENSUS }, + }; /** True iff we have logged a warning about this OR's version being older than * listed by the authorities. */ @@ -754,6 +758,9 @@ update_consensus_networkstatus_downloads(time_t now) resource = networkstatus_get_flavor_name(i); + /* Let's make sure we remembered to update consensus_dl_status */ + tor_assert(consensus_dl_status[i].schedule == DL_SCHED_CONSENSUS); + if (!download_status_is_ready(&consensus_dl_status[i], now, options->TestingConsensusMaxDownloadTries)) continue; /* We failed downloading a consensus too recently. */ |