MXS-2512 Do not recalculate information that exists

As the end of the error packet is known, it is better to pass
around an iterator to that instead of recalculating it.
This commit is contained in:
Johan Wikman
2019-06-10 14:07:35 +03:00
parent 9d1f094c45
commit b09a4e676d
2 changed files with 19 additions and 10 deletions

View File

@ -244,9 +244,19 @@ private:
bool m_skip_next = false;
Error m_error;
void process_reply_start(mxs::Buffer::iterator it, uint32_t len);
/**
* @param it Iterator pointing to the command byte of an error packet.
* @param end Iterator pointing one past the end of the error packet.
*/
void process_reply_start(mxs::Buffer::iterator it, mxs::Buffer::iterator end);
void update_error(mxs::Buffer::iterator it, uint32_t len);
/**
* Update @c m_error.
*
* @param it Iterator that points to the first byte of the error code in an error packet.
* @param end Iterator pointing one past the end of the error packet.
*/
void update_error(mxs::Buffer::iterator it, mxs::Buffer::iterator end);
inline bool is_opening_cursor() const
{