aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_common.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-03-08 17:31:36 -0500
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:33 -0400
commitacc7c4ee9578e37a66dff6a09c86bee5777f782d (patch)
tree4be443a03e0419aba50c71334870864b03556bdd /src/or/hs_common.c
parent5e710368b3e9a19862422d4bd43f2c1d8d0ceba8 (diff)
downloadtor-acc7c4ee9578e37a66dff6a09c86bee5777f782d.tar.gz
tor-acc7c4ee9578e37a66dff6a09c86bee5777f782d.zip
prop224: Establish rendezvous circuit for service
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r--src/or/hs_common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index 102e4689fa..571f4c5178 100644
--- a/src/or/hs_common.c
+++ b/src/or/hs_common.c
@@ -19,6 +19,7 @@
#include "hs_common.h"
#include "hs_service.h"
#include "rendcommon.h"
+#include "rendservice.h"
/* Ed25519 Basepoint value. Taken from section 5 of
* https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03 */
@@ -724,7 +725,22 @@ hs_overlap_mode_is_active(const networkstatus_t *consensus, time_t now)
if (valid_after_tm.tm_hour > 0 && valid_after_tm.tm_hour < 12) {
return 1;
}
+ return 0;
+}
+
+/* Return 1 if any virtual port in ports needs a circuit with good uptime.
+ * Else return 0. */
+int
+hs_service_requires_uptime_circ(const smartlist_t *ports)
+{
+ tor_assert(ports);
+ SMARTLIST_FOREACH_BEGIN(ports, rend_service_port_config_t *, p) {
+ if (smartlist_contains_int_as_string(get_options()->LongLivedPorts,
+ p->virtual_port)) {
+ return 1;
+ }
+ } SMARTLIST_FOREACH_END(p);
return 0;
}