Add name and uri helpers to Backend

Providing helper functions for the commonly used parts of the server makes
code easier to read. It also removes any possibility for formatting
problems by moving the URI and name string handling inside the Backend
class.
This commit is contained in:
Markus Mäkelä
2017-06-19 14:01:03 +03:00
parent d7543988ee
commit c7520a2156
7 changed files with 61 additions and 32 deletions

View File

@ -292,9 +292,8 @@ void check_session_command_reply(GWBUF *buffer, SRWBackend backend)
err.append(replybuf + 8, 5);
msg.append(replybuf + 13, replylen - 4 - 5);
MXS_ERROR("Failed to execute session command in [%s]:%d. Error was: %s %s",
backend->server()->name, backend->server()->port,
err.c_str(), msg.c_str());
MXS_ERROR("Failed to execute session command in %s. Error was: %s %s",
backend->uri(), err.c_str(), msg.c_str());
}
}