MXS-2196: Move DCB initialization into DCB constructor

More of the DCB initialization is now done in the DCB constructor. This
makes the creation of new DCBs simpler but it can be even simpler. By
passing the file descriptor that the DCB should use into the constructor
almost all of the initialization would be done inside it.

Also removed the unused path member variable.
This commit is contained in:
Markus Mäkelä
2018-12-01 21:29:30 +02:00
parent 6cf672195a
commit 8046a314e5
4 changed files with 17 additions and 36 deletions

View File

@ -332,26 +332,13 @@ static int mysql_auth_authenticate(DCB* dcb)
strcpy(extra, "Wrong password.");
}
if (dcb->path)
{
MXS_LOG_EVENT(maxscale::event::AUTHENTICATION_FAILURE,
"%s: login attempt for user '%s'@[%s]:%s, authentication failed. %s",
dcb->service->name,
client_data->user,
dcb->remote,
dcb->path,
extra);
}
else
{
MXS_LOG_EVENT(maxscale::event::AUTHENTICATION_FAILURE,
"%s: login attempt for user '%s'@[%s]:%d, authentication failed. %s",
dcb->service->name,
client_data->user,
dcb->remote,
dcb_get_port(dcb),
extra);
}
MXS_LOG_EVENT(maxscale::event::AUTHENTICATION_FAILURE,
"%s: login attempt for user '%s'@[%s]:%d, authentication failed. %s",
dcb->service->name,
client_data->user,
dcb->remote,
dcb_get_port(dcb),
extra);
if (is_localhost_address(&dcb->ip)
&& !dcb->service->localhost_match_wildcard_host)