[tor-commits] [tor/master] Comment that failure schedules always use exponential backoff

nickm at torproject.org nickm at torproject.org
Fri Jul 7 17:29:20 UTC 2017


commit 527c0735f11d5a36aa1fb84dc30b624139ba8406
Author: teor <teor2345 at gmail.com>
Date:   Wed Jul 5 01:45:28 2017 +1000

    Comment that failure schedules always use exponential backoff
---
 src/or/directory.c | 2 ++
 src/or/or.h        | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index ccec810..fc21078 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -3771,6 +3771,8 @@ 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)));
+  /* Increment on failure schedules always use exponential backoff, but they
+   * have a smaller limit when they're deterministic */
   if (dls->backoff == DL_SCHED_DETERMINISTIC)
     *max = *((int *)((smartlist_get(schedule, smartlist_len(schedule) - 1))));
   else
diff --git a/src/or/or.h b/src/or/or.h
index b7c67ba..8a217a0 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1981,7 +1981,9 @@ typedef struct download_status_t {
                                         * or after each failure? */
   download_schedule_backoff_bitfield_t backoff : 1; /**< do we use the
                                         * deterministic schedule, or random
-                                        * exponential backoffs? */
+                                        * exponential backoffs?
+                                        * Increment on failure schedules
+                                        * always use exponential backoff. */
   uint8_t last_backoff_position; /**< number of attempts/failures, depending
                                   * on increment_on, when we last recalculated
                                   * the delay.  Only updated if backoff





More information about the tor-commits mailing list