summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-03-12 08:40:26 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-03-17 11:53:09 -0400
commit066748c9cde058db4c12dec0675c036ac11d7e84 (patch)
tree611902268bbf51261e86cb9454cd23b4be652a87 /src/core
parente8d224dfb14a73e6b47ab09def56217f66a2ea46 (diff)
downloadtor-066748c9cde058db4c12dec0675c036ac11d7e84.tar.gz
tor-066748c9cde058db4c12dec0675c036ac11d7e84.zip
Add a DormantTimeoutEnabled to disable dormant mode entirely
(If you need to do this in an older version you can just set DormantClientTimeout to something huge.) Closes #40228.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mainloop/mainloop.c6
-rw-r--r--src/core/mainloop/netstatus.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index 77ab6f26c8..dcd88b1a86 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -1823,6 +1823,12 @@ check_network_participation_callback(time_t now, const or_options_t *options)
goto found_activity;
}
+ /* If we aren't allowed to become dormant, then participation doesn't
+ matter */
+ if (! options->DormantTimeoutEnabled) {
+ goto found_activity;
+ }
+
/* If we're running an onion service, we can't become dormant. */
/* XXXX this would be nice to change, so that we can be dormant with a
* service. */
diff --git a/src/core/mainloop/netstatus.c b/src/core/mainloop/netstatus.c
index 7367c68219..fc386c191e 100644
--- a/src/core/mainloop/netstatus.c
+++ b/src/core/mainloop/netstatus.c
@@ -154,6 +154,9 @@ netstatus_load_from_state(const mainloop_state_t *state, time_t now)
last_activity = now;
participating_on_network = true;
}
+ if (! get_options()->DormantTimeoutEnabled) {
+ participating_on_network = true;
+ }
reset_user_activity(last_activity);
}