summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-04-11 14:47:42 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-16 10:36:21 -0400
commitb41dd8069f25ef6f6fdb22088291e23e0442476e (patch)
tree899597a45d6fd1efaffe95af990d293571b6d90a /src/or/main.c
parentd9ceab5bc3611fa6ed4e2f58d38ff26860eeeb3c (diff)
downloadtor-b41dd8069f25ef6f6fdb22088291e23e0442476e.tar.gz
tor-b41dd8069f25ef6f6fdb22088291e23e0442476e.zip
When ReloadTorrcOnSIGHUP=1, do non-reload activities anyway
Previously, we skipped everything that got invoked from options_init_from_torrc. But some of the stuff in options_act_reversible and options_act is actually important, like reopening the logs. Now, a SIGHUP always makes the effects of an options_set() happen, even though the options haven't changed. Fix for bug 5095; bugfix on 0.2.1.9-alpha, which introduced __ReloadTorrcOnSIGHUP.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 9022f2eb87..8308b3a238 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1773,8 +1773,16 @@ do_hup(void)
}
options = get_options(); /* they have changed now */
} else {
+ char *msg = NULL;
log_notice(LD_GENERAL, "Not reloading config file: the controller told "
"us not to.");
+ /* Make stuff get rescanned, reloaded, etc. */
+ if (set_options((or_options_t*)options, &msg) < 0) {
+ if (!msg)
+ msg = tor_strdup("Unknown error");
+ log_warn(LD_GENERAL, "Unable to re-set previous options: %s", msg);
+ tor_free(msg);
+ }
}
if (authdir_mode_handles_descs(options, -1)) {
/* reload the approved-routers file */