diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-24 08:51:55 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-24 08:51:55 -0400 |
commit | 6182f60f758f85a214a7e84d76f6fddb2bffd730 (patch) | |
tree | e7e177590a44a782a373bfbb15348741a5ed1539 /src/or/config.c | |
parent | e8683bcbb19318fcd9df04464296d6581adc959d (diff) | |
parent | d2951b381bcbd45798b6cf8f01c5ce7a4d9ad4b9 (diff) | |
download | tor-6182f60f758f85a214a7e84d76f6fddb2bffd730.tar.gz tor-6182f60f758f85a214a7e84d76f6fddb2bffd730.zip |
Merge branch 'maint-0.3.2' into maint-0.3.3
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 986794cec5..cf2f584980 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2180,9 +2180,16 @@ options_act(const or_options_t *old_options) if (transition_affects_workers) { log_info(LD_GENERAL, "Worker-related options changed. Rotating workers."); + const int server_mode_turned_on = + server_mode(options) && !server_mode(old_options); + const int dir_server_mode_turned_on = + dir_server_mode(options) && !dir_server_mode(old_options); - if (server_mode(options) && !server_mode(old_options)) { + if (server_mode_turned_on || dir_server_mode_turned_on) { cpu_init(); + } + + if (server_mode_turned_on) { ip_address_changed(0); if (have_completed_a_circuit() || !any_predicted_circuits(time(NULL))) inform_testing_reachability(); @@ -4749,7 +4756,8 @@ options_transition_affects_workers(const or_options_t *old_options, YES_IF_CHANGED_LINELIST(Logs); if (server_mode(old_options) != server_mode(new_options) || - public_server_mode(old_options) != public_server_mode(new_options)) + public_server_mode(old_options) != public_server_mode(new_options) || + dir_server_mode(old_options) != dir_server_mode(new_options)) return 1; /* Nothing that changed matters. */ |