Guarantee router session is present for call to clientReply; properly free callbacks; attempt to set all necessary values for dbusers; do more to ensure buffers freed.
This commit is contained in:
@ -156,7 +156,7 @@ char *password;
|
||||
maxscaled->username = strndup(GWBUF_DATA(head), GWBUF_LENGTH(head));
|
||||
maxscaled->state = MAXSCALED_STATE_PASSWD;
|
||||
dcb_printf(dcb, "PASSWORD");
|
||||
gwbuf_consume(head, GWBUF_LENGTH(head));
|
||||
while ((head = gwbuf_consume(head, GWBUF_LENGTH(head))) != NULL);
|
||||
break;
|
||||
case MAXSCALED_STATE_PASSWD:
|
||||
password = strndup(GWBUF_DATA(head), GWBUF_LENGTH(head));
|
||||
@ -170,7 +170,7 @@ char *password;
|
||||
dcb_printf(dcb, "FAILED");
|
||||
maxscaled->state = MAXSCALED_STATE_LOGIN;
|
||||
}
|
||||
gwbuf_consume(head, GWBUF_LENGTH(head));
|
||||
while ((head = gwbuf_consume(head, GWBUF_LENGTH(head))) != NULL);
|
||||
free(password);
|
||||
break;
|
||||
case MAXSCALED_STATE_DATA:
|
||||
@ -182,7 +182,7 @@ char *password;
|
||||
else
|
||||
{
|
||||
// Force the free of the buffer header
|
||||
gwbuf_consume(head, 0);
|
||||
while ((head = gwbuf_consume(head, GWBUF_LENGTH(head))) != NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -569,7 +569,8 @@ static int gw_read_backend_event(DCB *dcb) {
|
||||
*/
|
||||
if (dcb->session->state == SESSION_STATE_ROUTER_READY &&
|
||||
dcb->session->client != NULL &&
|
||||
dcb->session->client->state == DCB_STATE_POLLING)
|
||||
dcb->session->client->state == DCB_STATE_POLLING &&
|
||||
session->router_session)
|
||||
{
|
||||
client_protocol = SESSION_PROTOCOL(dcb->session,
|
||||
MySQLProtocol);
|
||||
|
Reference in New Issue
Block a user