]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Reset dormancy status when the clock jumps.
authorNick Mathewson <nickm@torproject.org>
Tue, 13 Nov 2018 20:57:18 +0000 (15:57 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 Nov 2018 16:17:22 +0000 (11:17 -0500)
src/core/mainloop/mainloop.c

index e6dee94fcc9dcb2a018b4975116977ca306a3ab5..2a68e8c098943f21f24a5f614fd189e5bd42e372 100644 (file)
@@ -2674,6 +2674,11 @@ update_current_time(time_t now)
   if (seconds_elapsed < -NUM_JUMPED_SECONDS_BEFORE_WARN) {
     // moving back in time is always a bad sign.
     circuit_note_clock_jumped(seconds_elapsed, false);
+
+    /* Don't go dormant just because we jumped in time. */
+    if (is_participating_on_network()) {
+      reset_user_activity(now);
+    }
   } else if (seconds_elapsed >= NUM_JUMPED_SECONDS_BEFORE_WARN) {
     /* Compare the monotonic clock to the result of time(). */
     const int32_t monotime_msec_passed =
@@ -2695,6 +2700,11 @@ update_current_time(time_t now)
     if (clock_jumped || seconds_elapsed >= NUM_IDLE_SECONDS_BEFORE_WARN) {
       circuit_note_clock_jumped(seconds_elapsed, ! clock_jumped);
     }
+
+    /* Don't go dormant just because we jumped in time. */
+    if (is_participating_on_network()) {
+      reset_user_activity(now);
+    }
   } else if (seconds_elapsed > 0) {
     stats_n_seconds_working += seconds_elapsed;
   }