diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-24 08:51:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-24 08:51:58 -0400 |
commit | 9be7608fda470713c4b9cd39a55f482706311717 (patch) | |
tree | 851cee5d5a6e436cb0f2e46e016e53bd972afcfe /src/or/config.c | |
parent | 192c7c8bf9a3c53d32e83557ebc62cf7cfa3b1ca (diff) | |
parent | 6182f60f758f85a214a7e84d76f6fddb2bffd730 (diff) | |
download | tor-9be7608fda470713c4b9cd39a55f482706311717.tar.gz tor-9be7608fda470713c4b9cd39a55f482706311717.zip |
Merge branch '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 1923afe7d0..87a3588db7 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2174,9 +2174,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(); @@ -4738,7 +4745,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. */ |