MXS-2196: Rename dcb_role_t to DCB::Role

This commit is contained in:
Markus Mäkelä
2018-12-04 12:02:10 +02:00
parent 0b9241913c
commit 77477d9648
21 changed files with 93 additions and 94 deletions

View File

@ -401,7 +401,7 @@ static inline void prepare_for_write(DCB* dcb, GWBUF* buffer)
{
MySQLProtocol* proto = (MySQLProtocol*)dcb->protocol;
// The DCB's session is set to null when it is put into the persistent connection pool.
// The DCB's session is set to null when it is put into the persistent connection pool.
if (dcb->session)
{
uint64_t capabilities = service_get_capabilities(dcb->session->service);
@ -645,7 +645,7 @@ static inline bool session_ok_to_route(DCB* dcb)
rval = true;
}
}
else if (dcb->session->client_dcb->dcb_role == DCB_ROLE_INTERNAL)
else if (dcb->session->client_dcb->role == DCB::Role::INTERNAL)
{
rval = true;
}
@ -1351,7 +1351,7 @@ static int gw_backend_hangup(DCB* dcb)
if (error != 0 && session->state != SESSION_STATE_STOPPING)
{
MXS_ERROR("Hangup in session that is not ready for routing, "
"Error reported is '%s'.",
"Error reported is '%s'.",
mxs_strerror(errno));
}
}

View File

@ -456,7 +456,7 @@ int gw_read_client_event(DCB* dcb)
uint32_t nbytes_read = 0;
uint32_t max_bytes = 0;
if (dcb->dcb_role != DCB_ROLE_CLIENT_HANDLER)
if (dcb->role != DCB::Role::CLIENT)
{
MXS_ERROR("DCB must be a client handler for MySQL client protocol.");
return 1;

View File

@ -590,7 +590,7 @@ bool gw_get_shared_session_auth_info(DCB* dcb, MYSQL_session* session)
{
bool rval = true;
if (dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER)
if (dcb->role == DCB::Role::CLIENT)
{
// The shared session data can be extracted at any time if the client DCB is used.
mxb_assert(dcb->data);
@ -1385,7 +1385,7 @@ static bool kill_func(DCB* dcb, void* data)
{
ConnKillInfo* info = static_cast<ConnKillInfo*>(data);
if (dcb->session->ses_id == info->target_id && dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER)
if (dcb->session->ses_id == info->target_id && dcb->role == DCB::Role::BACKEND)
{
MySQLProtocol* proto = (MySQLProtocol*)dcb->protocol;
@ -1411,7 +1411,7 @@ static bool kill_user_func(DCB* dcb, void* data)
{
UserKillInfo* info = (UserKillInfo*)data;
if (dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER
if (dcb->role == DCB::Role::BACKEND
&& strcasecmp(dcb->session->client_dcb->user, info->user.c_str()) == 0)
{
info->targets[dcb->server] = info->query_base;