[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Reset dormancy status when the clock jumps.
commit d0e6abd0876f0d4adb0b82f5528220a81b34962e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Tue Nov 13 15:57:18 2018 -0500
Reset dormancy status when the clock jumps.
---
src/core/mainloop/mainloop.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index e6dee94fc..2a68e8c09 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -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;
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits