Clear residual buffered data when reconnecting to the master in all cases

This commit is contained in:
Mark Riddoch
2015-01-26 11:23:46 +00:00
parent ef830b6553
commit b758dc1a4a

View File

@ -104,6 +104,15 @@ GWBUF *buf;
return;
}
router->master_state = BLRM_CONNECTING;
/* Discard the queued residual data */
buf = router->residual;
while (buf)
{
buf = gwbuf_consume(buf, GWBUF_LENGTH(buf));
}
router->residual = NULL;
spinlock_release(&router->lock);
if ((client = dcb_alloc(DCB_ROLE_INTERNAL)) == NULL)
{