This commit is contained in:
VilhoRaatikka
2014-11-14 13:06:35 +02:00
parent 238c476d3a
commit 77aa9827fe

View File

@ -539,10 +539,13 @@ static int gw_read_backend_event(DCB *dcb) {
goto return_rc;
}
}
/*<
* If dcb->session->client is freed already it may be NULL.
/**
* Check that session is operable, and that client DCB is
* still listening the socket for replies.
*/
if (dcb->session->client != NULL)
if (dcb->session->state == SESSION_STATE_ROUTER_READY &&
dcb->session->client != NULL &&
dcb->session->client->state == DCB_STATE_POLLING)
{
client_protocol = SESSION_PROTOCOL(dcb->session,
MySQLProtocol);
@ -571,6 +574,10 @@ static int gw_read_backend_event(DCB *dcb) {
rc = 1;
}
}
else /*< session is closing; replying to client isn't possible */
{
gwbuf_free(read_buffer);
}
}
return_rc: