]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Call cpu_init if we change to being a relay
authorSebastian Hahn <sebastian@torproject.org>
Sun, 15 Feb 2015 10:49:19 +0000 (11:49 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Sun, 15 Feb 2015 10:49:19 +0000 (11:49 +0100)
The issue is that we use the cpuworker system with relays only, so if we
start up as a client and transition to being a relay later, we'll be
sad.

This fixes bug 14901; not in any released version of Tor.

src/or/config.c
src/or/cpuworker.c

index ad4fd458463aeba9666bf9a7076782b975c2b26b..8d15d0df2fe6b4daef18f745ab967cac79036edc 100644 (file)
@@ -1721,6 +1721,7 @@ options_act(const or_options_t *old_options)
                "Worker-related options changed. Rotating workers.");
 
       if (server_mode(options) && !server_mode(old_options)) {
+        cpu_init();
         ip_address_changed(0);
         if (have_completed_a_circuit() || !any_predicted_circuits(time(NULL)))
           inform_testing_reachability();
index c5e78ed71672645d529ea9079c79e2242fc8261e..5787c75530934615ce93e7e8e11fe8fcbe41d275 100644 (file)
@@ -71,7 +71,8 @@ replyqueue_process_cb(evutil_socket_t sock, short events, void *arg)
   replyqueue_process(rq);
 }
 
-/** Initialize the cpuworker subsystem.
+/** Initialize the cpuworker subsystem. It is OK to call this more than once
+ * during Tor's lifetime.
  */
 void
 cpu_init(void)