]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Treat bacoff/schedule mismatch as a bug.
authorNick Mathewson <nickm@torproject.org>
Mon, 7 Nov 2016 16:05:57 +0000 (11:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 7 Nov 2016 16:05:57 +0000 (11:05 -0500)
changes/bug20593.2 [new file with mode: 0644]
src/or/directory.c

diff --git a/changes/bug20593.2 b/changes/bug20593.2
new file mode 100644 (file)
index 0000000..bdaaf00
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features (diagnostic, directory client):
+    - Warn if we find an unexpected inconsistency in directory download
+      status objects. Prevents some negative consequences of bug 20593.
+
index 452571f2a793a9b58af7aec8b5f138d456e2abd8..6a681ef23b0061a13652a885eba1d7c0a14f16c4 100644 (file)
@@ -4055,7 +4055,7 @@ download_status_schedule_get_delay(download_status_t *dls,
       delay = *(int *)smartlist_get(schedule, smartlist_len(schedule) - 1);
   } else if (dls->backoff == DL_SCHED_RANDOM_EXPONENTIAL) {
     /* Check if we missed a reset somehow */
-    if (dls->last_backoff_position > dls_schedule_position) {
+    IF_BUG_ONCE(dls->last_backoff_position > dls_schedule_position) {
       dls->last_backoff_position = 0;
       dls->last_delay_used = 0;
     }