]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't build introduction circuits until we know we can build circuits
authorNick Mathewson <nickm@torproject.org>
Thu, 20 Nov 2014 16:51:36 +0000 (11:51 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 20 Nov 2014 16:51:36 +0000 (11:51 -0500)
Patch from akwizgran.  Ticket 13447.

changes/bug13447 [new file with mode: 0644]
src/or/config.c
src/or/rendservice.c

diff --git a/changes/bug13447 b/changes/bug13447
new file mode 100644 (file)
index 0000000..90027e8
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor feature:
+    - When re-enabling the network, don't try to build introduction circuits
+      until we have successfully built a circuit.  This makes hidden services
+      come up faster when the network is re-enabled. Patch from
+      "akwizgran". Closes ticket 13447.
index dc2fc13b9a5fc2664eff0bf4dce993a75ae8e668..5b62c565b900ed3ce5566f53c98d0fd70c08b3b0 100644 (file)
@@ -1071,6 +1071,8 @@ options_act_reversible(const or_options_t *old_options, char **msg)
                  "non-control network connections. Shutting down all existing "
                  "connections.");
       connection_mark_all_noncontrol_connections();
+      /* We can't complete circuits until the network is re-enabled. */
+      can_complete_circuit = 0;
     }
   }
 
index 3fed540e846fccc9029ce1d73f102ea29d23b4d5..353c671550bebcc0499ffb3a9cad9f4f8fd8390b 100644 (file)
@@ -16,6 +16,7 @@
 #include "circuituse.h"
 #include "config.h"
 #include "directory.h"
+#include "main.h"
 #include "networkstatus.h"
 #include "nodelist.h"
 #include "rendclient.h"
@@ -3074,6 +3075,9 @@ rend_services_introduce(void)
    * an intro point to. */
   smartlist_t *exclude_nodes = smartlist_new();
 
+  if (!can_complete_circuit)
+    return;
+
   now = time(NULL);
 
   for (i=0; i < smartlist_len(rend_service_list); ++i) {