mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Merge branch 'bug5095_squashed'
This commit is contained in:
commit
891cf72f71
3 changed files with 16 additions and 2 deletions
4
changes/bug5095
Normal file
4
changes/bug5095
Normal file
|
@ -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.
|
|
@ -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
|
/* Issues a CONF_CHANGED event to notify controller of the change. If Tor is
|
||||||
* just starting up then the old_options will be undefined. */
|
* just starting up then the old_options will be undefined. */
|
||||||
if (old_options) {
|
if (old_options && old_options != global_options) {
|
||||||
elements = smartlist_new();
|
elements = smartlist_new();
|
||||||
for (i=0; options_format.vars[i].name; ++i) {
|
for (i=0; options_format.vars[i].name; ++i) {
|
||||||
const config_var_t *var = &options_format.vars[i];
|
const config_var_t *var = &options_format.vars[i];
|
||||||
|
@ -774,6 +774,8 @@ set_options(or_options_t *new_val, char **msg)
|
||||||
control_event_conf_changed(elements);
|
control_event_conf_changed(elements);
|
||||||
smartlist_free(elements);
|
smartlist_free(elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (old_options != global_options)
|
||||||
config_free(&options_format, old_options);
|
config_free(&options_format, old_options);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1773,8 +1773,16 @@ do_hup(void)
|
||||||
}
|
}
|
||||||
options = get_options(); /* they have changed now */
|
options = get_options(); /* they have changed now */
|
||||||
} else {
|
} else {
|
||||||
|
char *msg = NULL;
|
||||||
log_notice(LD_GENERAL, "Not reloading config file: the controller told "
|
log_notice(LD_GENERAL, "Not reloading config file: the controller told "
|
||||||
"us not to.");
|
"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)) {
|
if (authdir_mode_handles_descs(options, -1)) {
|
||||||
/* reload the approved-routers file */
|
/* reload the approved-routers file */
|
||||||
|
|
Loading…
Add table
Reference in a new issue