mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Avoid disconnection warning if fin packet is received
This commit is contained in:
parent
9df2e6d6fb
commit
2bd232c982
@ -404,6 +404,7 @@ static void tmate_write_copy_mode(__unused struct tmate_session *session,
|
||||
static void tmate_fin(__unused struct tmate_session *session,
|
||||
__unused struct tmate_unpacker *uk)
|
||||
{
|
||||
session->fin_received = true;
|
||||
request_server_termination();
|
||||
}
|
||||
|
||||
|
@ -342,8 +342,16 @@ static void on_websocket_encoder_write(void *userdata, struct evbuffer *buffer)
|
||||
|
||||
static void on_websocket_event_default(__unused struct tmate_session *session, short events)
|
||||
{
|
||||
if (events & BEV_EVENT_EOF)
|
||||
if (events & BEV_EVENT_EOF) {
|
||||
if (session->fin_received) {
|
||||
/*
|
||||
* This is expected. The websocket will close the
|
||||
* connection upon receiving the fin message.
|
||||
*/
|
||||
exit(0);
|
||||
}
|
||||
tmate_fatal("Connection to websocket server closed");
|
||||
}
|
||||
|
||||
if (events & BEV_EVENT_ERROR)
|
||||
tmate_fatal("Connection to websocket server error: %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user