aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-11 14:54:16 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-11 14:54:16 -0500
commit0899f51bc6abf535c6c55b81b98b959235b0f7c7 (patch)
tree44e04c5c7656af2bbaa4643295dca21f013dfb9a /src/or
parentd9968dd0ab146b0d8db348c267c45241fa73bd67 (diff)
downloadtor-0899f51bc6abf535c6c55b81b98b959235b0f7c7.tar.gz
tor-0899f51bc6abf535c6c55b81b98b959235b0f7c7.zip
Additional paranoia: do not even build tor2web stuff if not using.
(That is, don't build it unless we're building for tor2web, or we are building for tests.)
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 38be827870..7662ef2303 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1735,6 +1735,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity)
return NULL;
}
+#if defined(ENABLE_TOR2WEB_MODE) || defined(TOR_UNIT_TESTS)
/* The config option Tor2webRendezvousPoints has been set and we need
* to pick an RP out of that set. Make sure that the RP we choose is
* alive, and return it. Return NULL if no usable RP could be found in
@@ -1786,6 +1787,7 @@ pick_tor2web_rendezvous_node(router_crn_flags_t flags,
return rp_node;
}
+#endif
/* Pick a Rendezvous Point for our HS circuits according to <b>flags</b>. */
static const node_t *
@@ -1796,6 +1798,7 @@ pick_rendezvous_node(router_crn_flags_t flags)
if (options->AllowInvalid_ & ALLOW_INVALID_RENDEZVOUS)
flags |= CRN_ALLOW_INVALID;
+#ifdef ENABLE_TOR2WEB_MODE
/* The user wants us to pick specific RPs. */
if (options->Tor2webRendezvousPoints) {
const node_t *tor2web_rp = pick_tor2web_rendezvous_node(flags, options);
@@ -1804,6 +1807,7 @@ pick_rendezvous_node(router_crn_flags_t flags)
}
/* Else, if no tor2web RP was found, fall back to choosing a random node */
}
+#endif
return router_choose_random_node(NULL, options->ExcludeNodes, flags);
}