[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Additional paranoia: do not even build tor2web stuff if not using.



commit 0899f51bc6abf535c6c55b81b98b959235b0f7c7
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Feb 11 14:54:16 2015 -0500

    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.)
---
 src/or/circuitbuild.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 38be827..7662ef2 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);
 }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits