MXS-2068: Move common functionality into RWBackend

The RWBackend now updates the internal state when a new write is done in
addition to acknowledging it when the reply is complete.
This commit is contained in:
Markus Mäkelä
2018-09-24 13:57:55 +03:00
parent 09a64753f1
commit a32361e894
5 changed files with 39 additions and 27 deletions

View File

@ -61,7 +61,6 @@ int32_t CatSession::routeQuery(GWBUF* pPacket)
// We have a backend, write the query only to this one. It will be
// propagated onwards in clientReply.
rval = (*m_current)->write(gwbuf_clone(pPacket));
(*m_current)->set_reply_state(REPLY_STATE_START);
}
return rval;
@ -75,7 +74,6 @@ void CatSession::clientReply(GWBUF* pPacket, DCB* pDcb)
if (backend->reply_is_complete(pPacket))
{
backend->ack_write();
m_completed++;
m_current++;
@ -88,7 +86,6 @@ void CatSession::clientReply(GWBUF* pPacket, DCB* pDcb)
else
{
(*m_current)->write(gwbuf_clone(m_query));
(*m_current)->set_reply_state(REPLY_STATE_START);
}
}