diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-10-17 13:24:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-08 07:56:16 -0500 |
commit | cb29687e93169e9615de3bc5adcbf6d31551b32c (patch) | |
tree | d119dad6ef6e4dee81f9a01e0a4b7d31a31f2196 /src/or/directory.h | |
parent | 43ebe54a24d3210ef037f7e2b67fad9597361bab (diff) | |
download | tor-cb29687e93169e9615de3bc5adcbf6d31551b32c.tar.gz tor-cb29687e93169e9615de3bc5adcbf6d31551b32c.zip |
Replace our random-exponential-delay algorithm.
This patch has implementations of the "decorrelated" and "full"
algorithms from https://www.awsarchitectureblog.com/2015/03/backoff.html
Diffstat (limited to 'src/or/directory.h')
-rw-r--r-- | src/or/directory.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/directory.h b/src/or/directory.h index 629b3ead90..c055e60d98 100644 --- a/src/or/directory.h +++ b/src/or/directory.h @@ -167,8 +167,14 @@ STATIC const smartlist_t *find_dl_schedule(download_status_t *dls, STATIC void find_dl_min_and_max_delay(download_status_t *dls, const or_options_t *options, int *min, int *max); -STATIC int next_random_exponential_delay(int delay, int max_delay); - +STATIC int next_random_exponential_delay(int delay, + int base_delay, + int max_delay); + +STATIC void next_random_exponential_delay_range(int *low_bound_out, + int *high_bound_out, + int delay, + int base_delay); #endif #endif |