Remove unnecessary result processing in readwritesplit

The result processing code did unnecessary work to confirm that the result
buffers are contiguous. The code also assumed that multiple packets can be
routed at the same time when in fact only one contiguous result packet is
returned at a time.

By assuming that the buffers are contiguous and contain only one packet,
most of the copying and buffer manipulation can be avoided.
This commit is contained in:
Markus Mäkelä
2017-10-05 16:03:00 +03:00
committed by Johan Wikman
parent 8085ee15be
commit 7840c86b7f
3 changed files with 49 additions and 16 deletions

View File

@ -17,7 +17,7 @@
RWBackend::RWBackend(SERVER_REF* ref):
mxs::Backend(ref),
m_reply_state(REPLY_STATE_DONE),
m_modutil_state(MODUTIL_STATE_INIT)
m_large_packet(false)
{
}
@ -35,14 +35,14 @@ void RWBackend::set_reply_state(reply_state_t state)
m_reply_state = state;
}
void RWBackend::set_modutil_state(const modutil_state& state)
void RWBackend::set_large_packet(bool value)
{
m_modutil_state = state;
m_large_packet = value;
}
modutil_state RWBackend::get_modutil_state() const
bool RWBackend::is_large_packet() const
{
return m_modutil_state;
return m_large_packet;
}
bool RWBackend::execute_session_command()