diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-13 15:57:18 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-15 11:17:22 -0500 |
commit | d0e6abd0876f0d4adb0b82f5528220a81b34962e (patch) | |
tree | 7de4360713e55cce74ae4cd3d7f89f8efe4c8314 /src/core | |
parent | ce6209cee4a113c6a224f0c98244852354ccdb40 (diff) | |
download | tor-d0e6abd0876f0d4adb0b82f5528220a81b34962e.tar.gz tor-d0e6abd0876f0d4adb0b82f5528220a81b34962e.zip |
Reset dormancy status when the clock jumps.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/mainloop.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index e6dee94fcc..2a68e8c098 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; } |