diff options
author | Andrea Shepard <andrea@torproject.org> | 2016-06-18 17:11:32 +0000 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2016-06-18 17:11:32 +0000 |
commit | 1dfbfd319e417c06c6e6d97d8c617522873ad43f (patch) | |
tree | 935a8007f0bab9eb168afa8e2aa73ca0aed95052 /src/or/directory.c | |
parent | 2905a3484eb02e5cf3bc3474240a42e24c07ab74 (diff) | |
download | tor-1dfbfd319e417c06c6e6d97d8c617522873ad43f.tar.gz tor-1dfbfd319e417c06c6e6d97d8c617522873ad43f.zip |
Better comment for download_status_schedule_get_delay() per code review
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 5b890cab1e..1a8fd2cb21 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3784,8 +3784,11 @@ find_dl_min_and_max_delay(download_status_t *dls, const or_options_t *options, *max = *((int *)((smartlist_get(schedule, smartlist_len(schedule) - 1)))); } -/* Find the current delay for dls based on schedule. - * Set dls->next_attempt_at based on now, and return the delay. +/** Find the current delay for dls based on schedule or min_delay/ + * max_delay if we're using exponential backoff. If dls->backoff is + * DL_SCHED_RANDOM_EXPONENTIAL, we must have 0 <= min_delay <= max_delay <= + * INT_MAX, but schedule may be set to NULL; otherwise schedule is required. + * This function sets dls->next_attempt_at based on now, and returns the delay. * Helper for download_status_increment_failure and * download_status_increment_attempt. */ STATIC int |