aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.h
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-05-26 16:16:37 +1000
committerNick Mathewson <nickm@torproject.org>2017-07-07 13:18:04 -0400
commitc21cfd28f43a969229ede02e20c6b554c1b88aae (patch)
tree2062691f3f8ade9d982a80f6a9743b8bbfd84461 /src/or/directory.h
parentec61ae59a5d009a9e80f3bfa9a2aa5f5dfa05551 (diff)
downloadtor-c21cfd28f43a969229ede02e20c6b554c1b88aae.tar.gz
tor-c21cfd28f43a969229ede02e20c6b554c1b88aae.zip
Make clients try fallbacks before authorities
Make clients wait for 6 seconds before trying to download their consensus from an authority. Fixes bug 17750, bugfix on 0.2.8.1-alpha.
Diffstat (limited to 'src/or/directory.h')
-rw-r--r--src/or/directory.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/directory.h b/src/or/directory.h
index 629b3ead90..8ff16b3535 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -114,6 +114,11 @@ static inline int
download_status_is_ready(download_status_t *dls, time_t now,
int max_failures)
{
+ /* dls wasn't reset before it was used */
+ if (dls->next_attempt_at == 0) {
+ download_status_reset(dls);
+ }
+
if (dls->backoff == DL_SCHED_DETERMINISTIC) {
/* Deterministic schedules can hit an endpoint; exponential backoff
* schedules just wait longer and longer. */
@@ -162,7 +167,7 @@ STATIC char* authdir_type_to_string(dirinfo_type_t auth);
STATIC const char * dir_conn_purpose_to_string(int purpose);
STATIC int should_use_directory_guards(const or_options_t *options);
STATIC zlib_compression_level_t choose_compression_level(ssize_t n_bytes);
-STATIC const smartlist_t *find_dl_schedule(download_status_t *dls,
+STATIC const smartlist_t *find_dl_schedule(const download_status_t *dls,
const or_options_t *options);
STATIC void find_dl_min_and_max_delay(download_status_t *dls,
const or_options_t *options,