aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitpadding.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-03-13 14:54:01 +0200
committerteor <teor@torproject.org>2019-03-21 10:29:04 +1000
commitbc64fb4e33ff98ca7271ee369fef24b3cf693574 (patch)
tree3df58c3f67eaff215f5dcfe0f7207a8a8467c656 /src/test/test_circuitpadding.c
parentfe78ba855a50c1f83e449d63d32e754bc988595a (diff)
downloadtor-bc64fb4e33ff98ca7271ee369fef24b3cf693574.tar.gz
tor-bc64fb4e33ff98ca7271ee369fef24b3cf693574.zip
circpad: Don't pad if Tor is in dormant mode.
This is something we should think about harder, but we probably want dormant mode to be more powerful than padding in case a client has been inactive for a day or so. After all, there are probably no circuits open at this point and dormant mode will not allow the client to open more circuits. Furthermore, padding should not block dormant mode from being activated, since dormant mode relies on SocksPort activity, and circuit padding does not mess with that.
Diffstat (limited to 'src/test/test_circuitpadding.c')
-rw-r--r--src/test/test_circuitpadding.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c
index 1976e54bb9..ba58cd0d97 100644
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@ -17,6 +17,7 @@
#include "core/or/circuitlist.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitpadding.h"
+#include "core/mainloop/netstatus.h"
#include "core/crypto/relay_crypto.h"
#include "core/or/protover.h"
#include "feature/nodelist/nodelist.h"
@@ -1021,6 +1022,9 @@ test_circuitpadding_tokens(void *arg)
monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
curr_mocked_time = 1*TOR_NSEC_PER_USEC;
+ /* This is needed so that we are not considered to be dormant */
+ note_user_activity(20);
+
timers_initialize();
helper_create_basic_machine();
@@ -1750,6 +1754,9 @@ test_circuitpadding_conditions(void *arg)
monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
curr_mocked_time = 1*TOR_NSEC_PER_USEC;
+ /* This is needed so that we are not considered to be dormant */
+ note_user_activity(20);
+
timers_initialize();
helper_create_conditional_machines();