Use only backend DCBs with session_unlink_backend_dcb

The client DCB isn't in the set of DCBs managed by the session.
This commit is contained in:
Markus Mäkelä 2018-08-06 11:45:06 +03:00
parent 9d30c524e3
commit a1d5a06ba7
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -240,18 +240,23 @@ dcb_final_free(DCB *dcb)
CHK_SESSION(local_session);
if (SESSION_STATE_DUMMY != local_session->state)
{
bool is_client_dcb = (DCB_ROLE_CLIENT_HANDLER == dcb->dcb_role ||
DCB_ROLE_SERVICE_LISTENER == dcb->dcb_role ||
DCB_ROLE_INTERNAL == dcb->dcb_role);
session_unlink_backend_dcb(local_session, dcb);
if (is_client_dcb)
if (dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER)
{
/** The client DCB is only freed once all other DCBs that the session
session_unlink_backend_dcb(local_session, dcb);
}
else
{
/**
* The client DCB is only freed once all other DCBs that the session
* uses have been freed. This will guarantee that the authentication
* data will be usable for all DCBs even if the client DCB has already
* been closed. */
* been closed.
*/
ss_dassert(dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER ||
dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER ||
dcb->dcb_role == DCB_ROLE_INTERNAL);
session_put_ref(local_session);
return;
}
}