MXS-1502: Add have_session_commands helper function

The function conveys the meaning of the call better than using
session_command_count to check whether there are session commands to be
executed.
This commit is contained in:
Markus Mäkelä
2018-03-30 08:40:01 +03:00
parent 7d4f37d25b
commit 319122e621
6 changed files with 21 additions and 11 deletions

View File

@ -398,7 +398,7 @@ static bool handle_error_new_connection(RWSplit *inst,
*/
gwbuf_free(stored);
if (backend->session_command_count() == 0)
if (!backend->have_session_commands())
{
/**
* The backend was executing a command that requires a reply.
@ -1104,13 +1104,13 @@ static void clientReply(MXS_ROUTER *instance,
rses->expected_responses, backend->name());
}
if (backend->session_command_count())
if (backend->have_session_commands())
{
/** Reply to an executed session command */
process_sescmd_response(rses, backend, &writebuf);
}
if (backend->session_command_count())
if (backend->have_session_commands())
{
if (backend->execute_session_command())
{