Don't send hangup error on connection close

If the client has sent a COM_QUIT, the hangup error message should not be
written.
This commit is contained in:
Markus Mäkelä
2017-11-30 17:25:06 +02:00
parent 016b0f69f7
commit f2a0cc8b31

View File

@ -1446,7 +1446,11 @@ static int gw_client_hangup_event(DCB *dcb)
goto retblock;
}
modutil_send_mysql_err_packet(dcb, 0, 0, 1927, "08S01", "Connection killed by MaxScale");
if (!session_valid_for_pool(session))
{
// The client did not send a COM_QUIT packet
modutil_send_mysql_err_packet(dcb, 0, 0, 1927, "08S01", "Connection killed by MaxScale");
}
dcb_close(dcb);
retblock: