diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-05-11 15:48:04 -0400 |
---|---|---|
committer | David Goulet <dgoulet@ev0ke.net> | 2015-06-29 11:12:31 -0400 |
commit | adc04580f860b5e8cfd6d49c83fdf73764a4f8cc (patch) | |
tree | 910cb2f19af5b0e2886d01447d752f9bdd14783f /src/or/rendservice.c | |
parent | 8dcbdf58a7fe3b1865b78387126cfe74dd0f0602 (diff) | |
download | tor-adc04580f860b5e8cfd6d49c83fdf73764a4f8cc.tar.gz tor-adc04580f860b5e8cfd6d49c83fdf73764a4f8cc.zip |
Add the torrc option HiddenServiceNumIntroductionPoints
This is a way to specify the amount of introduction points an hidden service
can have. Maximum value is 10 and the default is 3.
Fixes #4862
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index a1c7af6d17..aed01db693 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -87,6 +87,8 @@ struct rend_service_port_config_s { /** Try to maintain this many intro points per service by default. */ #define NUM_INTRO_POINTS_DEFAULT 3 +/** Maximum number of intro points per service. */ +#define NUM_INTRO_POINTS_MAX 10 /** If we can't build our intro circuits, don't retry for this long. */ #define INTRO_CIRC_RETRY_PERIOD (60*5) @@ -577,7 +579,22 @@ rend_config_services(const or_options_t *options, int validate_only) log_info(LD_CONFIG, "HiddenServiceMaxStreamsCloseCircuit=%d for %s", (int)service->max_streams_close_circuit, service->directory); - + } else if (!strcasecmp(line->key, "HiddenServiceNumIntroductionPoints")) { + service->n_intro_points_wanted = + (unsigned int) tor_parse_long(line->value, 10, + NUM_INTRO_POINTS_DEFAULT, + NUM_INTRO_POINTS_MAX, &ok, NULL); + if (!ok) { + log_warn(LD_CONFIG, + "HiddenServiceNumIntroductionPoints " + "should be between %d and %d, not %s", + NUM_INTRO_POINTS_DEFAULT, NUM_INTRO_POINTS_MAX, + line->value); + rend_service_free(service); + return -1; + } + log_info(LD_CONFIG, "HiddenServiceNumIntroductionPoints=%d for %s", + service->n_intro_points_wanted, service->directory); } else if (!strcasecmp(line->key, "HiddenServiceAuthorizeClient")) { /* Parse auth type and comma-separated list of client names and add a * rend_authorized_client_t for each client to the service's list |