diff options
author | David Goulet <dgoulet@torproject.org> | 2017-05-26 14:20:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:29:34 -0400 |
commit | 1b403a83821d86ac358e49ae24bd1284ed0dcfab (patch) | |
tree | dfe9183d4af65472a6764f37d6842fac10041f11 /src | |
parent | 15864a1b70c1061a89f97a2054b1c19788af7dbc (diff) | |
download | tor-1b403a83821d86ac358e49ae24bd1284ed0dcfab.tar.gz tor-1b403a83821d86ac358e49ae24bd1284ed0dcfab.zip |
prop224: Different intro point timings with TestingNetwork
Change the timing for intro point's lifetime and maximum amount of circuit we
are allowed to launch in a TestingNetwork. This is particurlarly useful for
chutney testing to test intro point rotation.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/or/hs_service.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 0b524a3a8d..d717b9ce2f 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -232,6 +232,11 @@ get_intro_point_max_introduce2(void) static int32_t get_intro_point_min_lifetime(void) { +#define MIN_INTRO_POINT_LIFETIME_TESTING 10 + if (get_options()->TestingTorNetwork) { + return MIN_INTRO_POINT_LIFETIME_TESTING; + } + /* The [0, 2147483647] range is quite large to accomodate anything we decide * in the future. */ return networkstatus_get_param(NULL, "hs_intro_min_lifetime", @@ -244,6 +249,11 @@ get_intro_point_min_lifetime(void) static int32_t get_intro_point_max_lifetime(void) { +#define MAX_INTRO_POINT_LIFETIME_TESTING 30 + if (get_options()->TestingTorNetwork) { + return MAX_INTRO_POINT_LIFETIME_TESTING; + } + /* The [0, 2147483647] range is quite large to accomodate anything we decide * in the future. */ return networkstatus_get_param(NULL, "hs_intro_max_lifetime", @@ -1771,6 +1781,13 @@ get_max_intro_circ_per_period(const hs_service_t *service) tor_assert(service->config.num_intro_points <= HS_CONFIG_V3_MAX_INTRO_POINTS); +/* For a testing network, allow to do it for the maximum amount so circuit + * creation and rotation and so on can actually be tested without limit. */ +#define MAX_INTRO_POINT_CIRCUIT_RETRIES_TESTING -1 + if (get_options()->TestingTorNetwork) { + return MAX_INTRO_POINT_CIRCUIT_RETRIES_TESTING; + } + num_wanted_ip = service->config.num_intro_points; /* The calculation is as follow. We have a number of intro points that we |