Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä
2018-02-05 10:22:43 +02:00
71 changed files with 2097 additions and 749 deletions

View File

@ -1090,8 +1090,7 @@ gw_read_finish_processing(DCB *dcb, GWBUF *read_buffer, uint64_t capabilities)
dcb_close(dcb);
MXS_ERROR("Routing the query failed. Session will be closed.");
}
if (proto->current_command == MXS_COM_QUIT)
else if (proto->current_command == MXS_COM_QUIT)
{
/** Close router session which causes closing of backends */
dcb_close(dcb);
@ -1404,29 +1403,20 @@ static int gw_client_close(DCB *dcb)
*/
static int gw_client_hangup_event(DCB *dcb)
{
MXS_SESSION* session;
CHK_DCB(dcb);
session = dcb->session;
MXS_SESSION* session = dcb->session;
if (session != NULL && session->state == SESSION_STATE_ROUTER_READY)
if (session)
{
CHK_SESSION(session);
if (session->state != SESSION_STATE_DUMMY && !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);
}
if (session != NULL && session->state == SESSION_STATE_STOPPING)
{
goto retblock;
}
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:
return 1;
}