summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-04-17 09:44:01 -0400
committerDavid Goulet <dgoulet@torproject.org>2018-04-23 10:57:28 -0400
commit1d864987cbdab4286eed8f3a86a488759dc322ae (patch)
tree4198fedb4c0e0a850386935d6330628978b0ec03 /src/or/config.c
parenta4fcdc5decfe60bbd95aee2e5586e90c40b73225 (diff)
downloadtor-1d864987cbdab4286eed8f3a86a488759dc322ae.tar.gz
tor-1d864987cbdab4286eed8f3a86a488759dc322ae.zip
config: Set up periodic events when options changes
In case we transitionned to a new role in Tor, we need to launch and/or destroy some periodic events. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 9c0b321b56..1923afe7d0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -903,8 +903,13 @@ set_options(or_options_t *new_val, char **msg)
smartlist_free(elements);
}
- if (old_options != global_options)
+ if (old_options != global_options) {
or_options_free(old_options);
+ /* If we are here it means we've successfully applied the new options and
+ * that the global options have been changed to the new values. We'll
+ * check if we need to remove or add periodic events. */
+ periodic_events_on_new_options(global_options);
+ }
return 0;
}