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

@ -583,7 +583,7 @@ static void do_handle_error(DCB *dcb, mxs_error_action_t action, const char *err
*/
if (!succp)
{
session->state = SESSION_STATE_STOPPING;
poll_fake_hangup_event(session->client_dcb);
}
}
@ -599,13 +599,8 @@ static void gw_reply_on_error(DCB *dcb, mxs_auth_state_t state)
MXS_SESSION *session = dcb->session;
CHK_SESSION(session);
if (!dcb->dcb_errhandle_called)
{
do_handle_error(dcb, ERRACT_REPLY_CLIENT,
"Authentication with backend failed. Session will be closed.");
session->state = SESSION_STATE_STOPPING;
dcb->dcb_errhandle_called = true;
}
do_handle_error(dcb, ERRACT_REPLY_CLIENT,
"Authentication with backend failed. Session will be closed.");
}
/**
@ -1351,7 +1346,7 @@ static int gw_backend_close(DCB *dcb)
session->state == SESSION_STATE_STOPPING &&
session->client_dcb->state == DCB_STATE_POLLING)
{
dcb_close(session->client_dcb);
poll_fake_hangup_event(session->client_dcb);
}
return 1;

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;
}