[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Treat bacoff/schedule mismatch as a bug.



commit 89edef6afbfc701fab5a8ce1f3d7399f7c3261c7
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Nov 7 11:05:57 2016 -0500

    Treat bacoff/schedule mismatch as a bug.
---
 changes/bug20593.2 | 4 ++++
 src/or/directory.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/changes/bug20593.2 b/changes/bug20593.2
new file mode 100644
index 0000000..bdaaf00
--- /dev/null
+++ b/changes/bug20593.2
@@ -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.
+
diff --git a/src/or/directory.c b/src/or/directory.c
index 452571f..6a681ef 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -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;
     }

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits