From f2a0cc8b31d890eb680738253aaa81f8f9135d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 30 Nov 2017 17:25:06 +0200 Subject: [PATCH] Don't send hangup error on connection close If the client has sent a COM_QUIT, the hangup error message should not be written. --- server/modules/protocol/MySQL/MySQLClient/mysql_client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/modules/protocol/MySQL/MySQLClient/mysql_client.c b/server/modules/protocol/MySQL/MySQLClient/mysql_client.c index a646263c1..758a18505 100644 --- a/server/modules/protocol/MySQL/MySQLClient/mysql_client.c +++ b/server/modules/protocol/MySQL/MySQLClient/mysql_client.c @@ -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: