Merge remote-tracking branch 'public/bug10449'

This commit is contained in:
Nick Mathewson 2014-02-25 16:09:15 -05:00
commit bf1678603f
2 changed files with 12 additions and 13 deletions

8
changes/bug10449 Normal file
View File

@ -0,0 +1,8 @@
o Minor bugfixes:
- Exit immediately when exiting because of dropped connection from
a process-owning controller. Previously, if we were running in
server mode, we would wait for a little while as in the when we
got an INT signal--but this was problematic, since there was no
feedback for the user. Controllers that want to do a clean
shutdown should send an INT signal, and let the user know what's
going on. Fix for bug 10449; bugfix on 0.2.2.28-beta.

View File

@ -3181,22 +3181,13 @@ connection_control_reached_eof(control_connection_t *conn)
static void
lost_owning_controller(const char *owner_type, const char *loss_manner)
{
int shutdown_slowly = server_mode(get_options());
log_notice(LD_CONTROL, "Owning controller %s has %s -- %s.",
owner_type, loss_manner,
shutdown_slowly ? "shutting down" : "exiting now");
log_notice(LD_CONTROL, "Owning controller %s has %s -- exiting now.",
owner_type, loss_manner);
/* XXXX Perhaps this chunk of code should be a separate function,
* called here and by process_signal(SIGINT). */
if (!shutdown_slowly) {
tor_cleanup();
exit(0);
}
/* XXXX This will close all listening sockets except control-port
* listeners. Perhaps we should close those too. */
hibernate_begin_shutdown();
tor_cleanup();
exit(0);
}
/** Called when <b>conn</b> is being freed. */