diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-05-16 10:36:30 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-16 10:36:30 -0400 |
commit | 891cf72f7103bc5b4de26ac974c0fd42a9d3c88f (patch) | |
tree | 899597a45d6fd1efaffe95af990d293571b6d90a | |
parent | d9ceab5bc3611fa6ed4e2f58d38ff26860eeeb3c (diff) | |
parent | b41dd8069f25ef6f6fdb22088291e23e0442476e (diff) | |
download | tor-891cf72f7103bc5b4de26ac974c0fd42a9d3c88f.tar tor-891cf72f7103bc5b4de26ac974c0fd42a9d3c88f.tar.gz |
Merge branch 'bug5095_squashed'
-rw-r--r-- | changes/bug5095 | 4 | ||||
-rw-r--r-- | src/or/config.c | 6 | ||||
-rw-r--r-- | src/or/main.c | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/changes/bug5095 b/changes/bug5095 new file mode 100644 index 000000000..81801eca4 --- /dev/null +++ b/changes/bug5095 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - When we receive a SIGHUP and the controller-use __ReloadTorrcOnSIGHUP + option is set to 0, perform other actions that SIGHUP usually causes + (like reopening the logs). Fixes bug 5095; bugfix on 0.2.1.9-alpha. diff --git a/src/or/config.c b/src/or/config.c index dcc57f8e7..27aa8a2f2 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -748,7 +748,7 @@ set_options(or_options_t *new_val, char **msg) } /* Issues a CONF_CHANGED event to notify controller of the change. If Tor is * just starting up then the old_options will be undefined. */ - if (old_options) { + if (old_options && old_options != global_options) { elements = smartlist_new(); for (i=0; options_format.vars[i].name; ++i) { const config_var_t *var = &options_format.vars[i]; @@ -774,7 +774,9 @@ set_options(or_options_t *new_val, char **msg) control_event_conf_changed(elements); smartlist_free(elements); } - config_free(&options_format, old_options); + + if (old_options != global_options) + config_free(&options_format, old_options); return 0; } diff --git a/src/or/main.c b/src/or/main.c index 9022f2eb8..8308b3a23 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 */ |