mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08: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
459abafcea
commit
81a457e6fb
5
server.c
5
server.c
@ -202,8 +202,8 @@ error:
|
|||||||
server_write_error(c, cause);
|
server_write_error(c, cause);
|
||||||
xfree(cause);
|
xfree(cause);
|
||||||
|
|
||||||
|
sigterm = 1;
|
||||||
server_shutdown();
|
server_shutdown();
|
||||||
c->flags |= CLIENT_BAD;
|
|
||||||
|
|
||||||
exit(server_main(srv_fd));
|
exit(server_main(srv_fd));
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ server_main(int srv_fd)
|
|||||||
|
|
||||||
/* Update socket permissions. */
|
/* Update socket permissions. */
|
||||||
xtimeout = INFTIM;
|
xtimeout = INFTIM;
|
||||||
if (sigterm || server_update_socket() != 0)
|
if (server_update_socket() != 0)
|
||||||
xtimeout = POLL_TIMEOUT;
|
xtimeout = POLL_TIMEOUT;
|
||||||
|
|
||||||
/* Do the poll. */
|
/* Do the poll. */
|
||||||
@ -420,7 +420,6 @@ server_shutdown(void)
|
|||||||
server_lost_client(c);
|
server_lost_client(c);
|
||||||
else
|
else
|
||||||
server_write_client(c, MSG_SHUTDOWN, NULL, 0);
|
server_write_client(c, MSG_SHUTDOWN, NULL, 0);
|
||||||
c->flags |= CLIENT_BAD;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user