MXS-2068: Split reply_is_complete into two functions

By splitting the processing and state querying into two separate
functions, the result can be inspected multiple times without triggering
the result processing.
This commit is contained in:
Markus Mäkelä
2018-09-25 12:49:02 +03:00
parent 60cb8127a0
commit 24b438c9b6
4 changed files with 21 additions and 15 deletions

View File

@ -72,7 +72,9 @@ void CatSession::clientReply(GWBUF* pPacket, DCB* pDcb)
mxb_assert(backend->dcb() == pDcb);
bool send = false;
if (backend->reply_is_complete(pPacket))
backend->process_reply(pPacket);
if (backend->reply_is_complete())
{
m_completed++;
m_current++;

View File

@ -560,7 +560,9 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb)
m_current_query.reset();
}
if (backend->reply_is_complete(writebuf))
backend->process_reply(writebuf);
if (backend->reply_is_complete())
{
/** Got a complete reply, decrement expected response count */
m_expected_responses--;