summaryrefslogtreecommitdiff
path: root/src/or/directory.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-07 09:32:21 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-07 09:32:21 -0500
commit800dff13080111b1ce1c2f5e28d9ba326299f62a (patch)
tree5eb0f55bd231efd1f60c9d89b3c770e26148a48a /src/or/directory.h
parenta415fee58abf7285e4d42652755b8f34da273f6d (diff)
parente4b793fe41fc09cc1f7753cfe90b74095a49a34f (diff)
downloadtor-800dff13080111b1ce1c2f5e28d9ba326299f62a.tar.gz
tor-800dff13080111b1ce1c2f5e28d9ba326299f62a.zip
Merge branch 'maint-0.2.9'
Diffstat (limited to 'src/or/directory.h')
-rw-r--r--src/or/directory.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/directory.h b/src/or/directory.h
index acb7394136..589df7b70d 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -114,9 +114,15 @@ static inline int
download_status_is_ready(download_status_t *dls, time_t now,
int max_failures)
{
- int under_failure_limit = (dls->n_download_failures <= max_failures
- && dls->n_download_attempts <= max_failures);
- return (under_failure_limit && dls->next_attempt_at <= now);
+ if (dls->backoff == DL_SCHED_DETERMINISTIC) {
+ /* Deterministic schedules can hit an endpoint; exponential backoff
+ * schedules just wait longer and longer. */
+ int under_failure_limit = (dls->n_download_failures <= max_failures
+ && dls->n_download_attempts <= max_failures);
+ if (!under_failure_limit)
+ return 0;
+ }
+ return dls->next_attempt_at <= now;
}
static void download_status_mark_impossible(download_status_t *dl);