mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-24 00:53:31 +01:00
When shutting down the server, expect clients to be polite and exit when asked
with the right message.
This commit is contained in:
parent
a5c17d77bf
commit
afd0bd7cb0
7
server.c
7
server.c
@ -1,4 +1,4 @@
|
||||
/* $Id: server.c,v 1.177 2009-08-31 22:30:15 tcunha Exp $ */
|
||||
/* $Id: server.c,v 1.178 2009-09-02 21:36:00 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -205,8 +205,8 @@ error:
|
||||
server_write_error(c, cause);
|
||||
xfree(cause);
|
||||
|
||||
sigterm = 1;
|
||||
server_shutdown();
|
||||
c->flags |= CLIENT_BAD;
|
||||
|
||||
exit(server_main(srv_fd));
|
||||
}
|
||||
@ -307,7 +307,7 @@ server_main(int srv_fd)
|
||||
|
||||
/* Update socket permissions. */
|
||||
xtimeout = INFTIM;
|
||||
if (sigterm || server_update_socket() != 0)
|
||||
if (server_update_socket() != 0)
|
||||
xtimeout = POLL_TIMEOUT;
|
||||
|
||||
/* Do the poll. */
|
||||
@ -423,7 +423,6 @@ server_shutdown(void)
|
||||
server_lost_client(c);
|
||||
else
|
||||
server_write_client(c, MSG_SHUTDOWN, NULL, 0);
|
||||
c->flags |= CLIENT_BAD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user