MXS-585: Fixed buffer length instead of packet length being used in a calculation

The usage of the buffer length in the authentication success checks causes
the authentication to fail with routers that don't require statement input.
This commit is contained in:
Markus Makela 2016-02-18 17:23:27 +02:00
parent c25ef2f72a
commit a947b33769

View File

@ -771,7 +771,9 @@ int gw_read_client_event(DCB* dcb)
}
}
if (stmt_input)
/** If the router requires statement input or we are still authenticating
* we need to make sure that a complete SQL packet is read before continuing */
if (stmt_input || protocol->protocol_auth_state == MYSQL_AUTH_SENT)
{
/**
@ -832,9 +834,8 @@ int gw_read_client_event(DCB* dcb)
{
case MYSQL_AUTH_SENT:
{
int auth_val;
auth_val = gw_mysql_do_authentication(dcb, &read_buffer);
read_buffer = gwbuf_make_contiguous(read_buffer);
int auth_val = gw_mysql_do_authentication(dcb, &read_buffer);
if (protocol->protocol_auth_state == MYSQL_AUTH_SSL_REQ ||
protocol->protocol_auth_state == MYSQL_AUTH_SSL_HANDSHAKE_ONGOING ||