MXS-1503: Make sure backend is in use before using it
The get_backend_from_dcb function needs to check that the backend is in use before comparing the pointer. This prevents stale pointers from being used and is logically more sound than relying on raw DCB matches.
This commit is contained in:
@ -207,6 +207,7 @@ bool Backend::connect(MXS_SESSION* session, SessionCommandList* sescmd)
|
||||
|
||||
bool Backend::write(GWBUF* buffer, response_type type)
|
||||
{
|
||||
ss_dassert(in_use());
|
||||
bool rval = m_dcb->func.write(m_dcb, buffer) != 0;
|
||||
|
||||
if (rval && type == EXPECT_RESPONSE)
|
||||
|
Reference in New Issue
Block a user