diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-19 16:30:53 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-19 16:30:53 -0500 |
commit | df4d5ebb7dfaac49915d7ef775fcbf242e6c688b (patch) | |
tree | c6ccb857cc9077dc00c7862be460ee8f49b942b3 /src/or/hs_common.c | |
parent | fa6137a903ef984f64d89e984cf285bf5158e08f (diff) | |
parent | 129456e22257d24c380bed0f9ebc9d68955a01df (diff) | |
download | tor-df4d5ebb7dfaac49915d7ef775fcbf242e6c688b.tar.gz tor-df4d5ebb7dfaac49915d7ef775fcbf242e6c688b.zip |
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r-- | src/or/hs_common.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c index 4c56b2d11f..0e7d789705 100644 --- a/src/or/hs_common.c +++ b/src/or/hs_common.c @@ -210,6 +210,23 @@ hs_check_service_private_dir(const char *username, const char *path, return 0; } +/* Default, minimum and maximum values for the maximum rendezvous failures + * consensus parameter. */ +#define MAX_REND_FAILURES_DEFAULT 2 +#define MAX_REND_FAILURES_MIN 1 +#define MAX_REND_FAILURES_MAX 10 + +/** How many times will a hidden service operator attempt to connect to + * a requested rendezvous point before giving up? */ +int +hs_get_service_max_rend_failures(void) +{ + return networkstatus_get_param(NULL, "hs_service_max_rdv_failures", + MAX_REND_FAILURES_DEFAULT, + MAX_REND_FAILURES_MIN, + MAX_REND_FAILURES_MAX); +} + /** Get the default HS time period length in minutes from the consensus. */ STATIC uint64_t get_time_period_length(void) |