summaryrefslogtreecommitdiff
path: root/src/or/hs_common.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-19 16:26:26 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-19 16:26:26 -0500
commitf870f9c8bcdbf2f8fd1c1e1feb9f88dc111ab25a (patch)
tree1725d467f118be34c702ec94c041ca8b6d788f35 /src/or/hs_common.c
parent44388757c44834d63614c4e13cf88931992afc2a (diff)
parentf98f7ca89865d1a477fc65165b92c86b9d8437fa (diff)
downloadtor-f870f9c8bcdbf2f8fd1c1e1feb9f88dc111ab25a.tar.gz
tor-f870f9c8bcdbf2f8fd1c1e1feb9f88dc111ab25a.zip
Merge branch 'bug24895_031_02' into bug24895_032_02
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r--src/or/hs_common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index a5cfaf03a8..e9d7323316 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)