Changed back the first part of gw_MySQLWrite_backend so that it is protected by dcb->authlock which must wait until authentication phase is complete. If authentication fails, the error is handled before next query starts its execution.

This commit is contained in:
VilhoRaatikka
2014-03-18 17:48:57 +02:00
parent 35c460457a
commit d10b240ae2

View File

@ -283,7 +283,6 @@ static int gw_read_backend_event(DCB *dcb) {
}
if (backend_protocol->state == MYSQL_AUTH_FAILED) {
spinlock_acquire(&dcb->delayqlock);
/*<
* vraa : errorHandle
@ -528,7 +527,8 @@ gw_MySQLWrite_backend(DCB *dcb, GWBUF *queue)
/*<
* Don't write to backend if backend_dcb is not in poll set anymore.
*/
spinlock_acquire(&dcb->dcb_initlock);
spinlock_acquire(&dcb->authlock);
if (dcb->state != DCB_STATE_POLLING) {
/*< vraa : errorHandle */
/*< Free buffer memory */
@ -546,9 +546,6 @@ gw_MySQLWrite_backend(DCB *dcb, GWBUF *queue)
spinlock_release(&dcb->dcb_initlock);
return 0;
}
spinlock_release(&dcb->dcb_initlock);
spinlock_acquire(&dcb->authlock);
/*<
* Now put the incoming data to the delay queue unless backend is
* connected with auth ok