MXS-2196: Rename session states

Minor renaming of the session state enum values. Also exposed the session
state stringification function in the public header and removed the
stringification macro.
This commit is contained in:
Markus Mäkelä
2018-12-05 14:34:45 +02:00
parent 7aaadfc550
commit 20fe9b9dca
15 changed files with 39 additions and 92 deletions

View File

@ -150,7 +150,7 @@ static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* instance, MXS_SESSION* session
inst->sessions = client;
pthread_mutex_unlock(&inst->lock);
session->state = SESSION_STATE_READY;
session->state = SESSION_STATE_CREATED;
return reinterpret_cast<MXS_ROUTER_SESSION*>(client);
}

View File

@ -164,7 +164,7 @@ static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* instance, MXS_SESSION* session
inst->sessions = client;
pthread_mutex_unlock(&inst->lock);
session->state = SESSION_STATE_READY;
session->state = SESSION_STATE_CREATED;
dcb_printf(session->client_dcb, "Welcome to the MariaDB Corporation MaxScale Debug Interface.\n");
dcb_printf(session->client_dcb, "Type help for a list of available commands.\n\n");

View File

@ -168,7 +168,7 @@ void HintRouterSession::handleError(GWBUF* pMessage,
case ERRACT_REPLY_CLIENT:
{
/* React to failed authentication, send message to client */
if (sesstate == SESSION_STATE_ROUTER_READY)
if (sesstate == SESSION_STATE_STARTED)
{
/* Send error report to client */
GWBUF* pCopy = gwbuf_clone(pMessage);

View File

@ -192,7 +192,7 @@ static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* instance, MXS_SESSION* session
inst->sessions = client;
pthread_mutex_unlock(&inst->lock);
session->state = SESSION_STATE_READY;
session->state = SESSION_STATE_CREATED;
return reinterpret_cast<MXS_ROUTER_SESSION*>(client);
}
@ -274,7 +274,7 @@ static void handleError(MXS_ROUTER* instance,
client_dcb = session->client_dcb;
if (session->state == SESSION_STATE_ROUTER_READY)
if (session->state == SESSION_STATE_STARTED)
{
client_dcb->func.write(client_dcb, gwbuf_clone(errbuf));
}

View File

@ -711,7 +711,7 @@ static void handleError(MXS_ROUTER* instance,
{
mxb_assert(problem_dcb->role == DCB::Role::BACKEND);
mxb_assert(problem_dcb->session->state == SESSION_STATE_ROUTER_READY);
mxb_assert(problem_dcb->session->state == SESSION_STATE_STARTED);
DCB* client_dcb = problem_dcb->session->client_dcb;
client_dcb->func.write(client_dcb, gwbuf_clone(errbuf));

View File

@ -1123,7 +1123,7 @@ void RWSplitSession::handle_error_reply_client(DCB* backend_dcb, GWBUF* errmsg)
backend->close();
if (sesstate == SESSION_STATE_ROUTER_READY)
if (sesstate == SESSION_STATE_STARTED)
{
m_client->func.write(m_client, gwbuf_clone(errmsg));
}

View File

@ -638,7 +638,7 @@ void SchemaRouterSession::handleError(GWBUF* pMessage,
case ERRACT_REPLY_CLIENT:
// The session pointer can be NULL if the creation fails when filters are being set up
if (m_client->session && m_client->session->state == SESSION_STATE_ROUTER_READY)
if (m_client->session && m_client->session->state == SESSION_STATE_STARTED)
{
m_client->func.write(m_client, gwbuf_clone(pMessage));
}