diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-06 20:14:34 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-07 09:19:35 -0500 |
commit | 858867a31a31b7a0065481b1f5ad108f02ab337a (patch) | |
tree | d0df5827144b3e4cb6213144514b4bd76ae63d4c /src | |
parent | 5385a023e105ffbb54f1c160298313c6a8cde57f (diff) | |
download | tor-858867a31a31b7a0065481b1f5ad108f02ab337a.tar.gz tor-858867a31a31b7a0065481b1f5ad108f02ab337a.zip |
Allow infinitely long delays in exponential-backoff downloads
It's only safe to remove the failure limit (per 20536) if we are in
fact waiting a bit longer each time we try to download.
Fixes bug 20534; bugfix on 0.2.9.1-alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/directory.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 24490b7426..5fc15724cc 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3770,7 +3770,10 @@ find_dl_min_and_max_delay(download_status_t *dls, const or_options_t *options, const smartlist_t *schedule = find_dl_schedule(dls, options); tor_assert(schedule != NULL && smartlist_len(schedule) >= 2); *min = *((int *)(smartlist_get(schedule, 0))); - *max = *((int *)((smartlist_get(schedule, smartlist_len(schedule) - 1)))); + if (dls->backoff == DL_SCHED_DETERMINISTIC) + *max = *((int *)((smartlist_get(schedule, smartlist_len(schedule) - 1)))); + else + *max = INT_MAX; } /** Advance one delay step. The algorithm is to use the previous delay to |