summaryrefslogtreecommitdiff
path: root/src/or/directory.h
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-07-05 01:32:06 +1000
committerNick Mathewson <nickm@torproject.org>2017-07-07 13:18:04 -0400
commit32f0cbc0f6fc7a53fc88a144e42fea9aca2cd073 (patch)
tree6964e9d4f8456a9bc1b45125caf707f7341820fd /src/or/directory.h
parentf30d355903343af3611ed2ec9828c4b6d1851168 (diff)
downloadtor-32f0cbc0f6fc7a53fc88a144e42fea9aca2cd073.tar.gz
tor-32f0cbc0f6fc7a53fc88a144e42fea9aca2cd073.zip
Refactor exponential backoff multipliers into macros
There are only so many times you can type "4".
Diffstat (limited to 'src/or/directory.h')
-rw-r--r--src/or/directory.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/directory.h b/src/or/directory.h
index c473d8e4ca..0b54943b60 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -177,5 +177,15 @@ STATIC int next_random_exponential_delay(int delay, int max_delay);
#endif
+#if defined(TOR_UNIT_TESTS) || defined(DIRECTORY_PRIVATE)
+/* Used only by directory.c and test_dir.c */
+
+/* no more than quadruple the previous delay (multiplier + 1) */
+#define DIR_DEFAULT_RANDOM_MULTIPLIER (3)
+/* no more than triple the previous delay */
+#define DIR_TEST_NET_RANDOM_MULTIPLIER (2)
+
+#endif
+
#endif