Call cpu_init if we change to being a relay

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.
This commit is contained in:
Sebastian Hahn
2015-02-15 11:49:19 +01:00
parent 424edd5710
commit 3bcdb26267
2 changed files with 3 additions and 1 deletions
+1
View 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();
+2 -1
View 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)