diff --git a/include/maxscale/dcb.hh b/include/maxscale/dcb.hh index e438c7aae..e3e2ad93c 100644 --- a/include/maxscale/dcb.hh +++ b/include/maxscale/dcb.hh @@ -191,7 +191,7 @@ struct DCB : public MXB_POLL_DATA void* protocol = nullptr; /**< The protocol specific state */ size_t protocol_packet_length = 0; /**< protocol packet length */ size_t protocol_bytes_processed = 0; /**< How many bytes have been read */ - struct session* session = nullptr; /**< The owning session */ + struct session* session; /**< The owning session */ SListener listener; /**< The origin of the connection */ MXS_PROTOCOL func = {}; /**< Protocol functions for the DCB */ MXS_AUTHENTICATOR authfunc = {}; /**< Authenticator functions for the DCB */ @@ -231,7 +231,6 @@ struct DCB : public MXB_POLL_DATA DCB* tail = nullptr; /**< Last DCB in owning thread's list */ } thread; uint32_t n_close = 0; /** How many times dcb_close has been called. */ - char* path = nullptr; /** If a Unix socket, the path it was bound to. */ }; /** diff --git a/server/core/dcb.cc b/server/core/dcb.cc index a4d9b9b65..8f560302e 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -168,6 +168,15 @@ DCB::DCB(dcb_role_t role, const SListener& listener, SERVICE* service) , service(service) , last_read(mxs_clock()) { + session_set_dummy(this); + + // TODO: Remove DCB_ROLE_INTERNAL to always have a valid listener + if (listener) + { + func = listener->protocol_func(); + authfunc = listener->auth_func(); + } + if (high_water && low_water) { dcb_add_callback(this, DCB_REASON_HIGH_WATER, downstream_throttle_callback, NULL); @@ -201,7 +210,6 @@ DCB::~DCB() MXS_FREE(remote); MXS_FREE(user); - MXS_FREE(path); MXS_FREE(protocol); gwbuf_free(delayq); gwbuf_free(writeq); @@ -1215,14 +1223,6 @@ void dcb_final_close(DCB* dcb) MXS_DEBUG("Closed socket %d on dcb %p.", dcb->fd, dcb); } - - if (dcb->path && (dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER)) - { - if (unlink(dcb->path) != 0) - { - MXS_ERROR("Could not unlink %s: %s", dcb->path, mxs_strerror(errno)); - } - } } else { diff --git a/server/core/listener.cc b/server/core/listener.cc index b845a21f2..463ac4079 100644 --- a/server/core/listener.cc +++ b/server/core/listener.cc @@ -942,7 +942,6 @@ DCB* dcb_accept(const SListener& listener) } else { - client_dcb->session = session_set_dummy(client_dcb); client_dcb->fd = c_sock; // get client address @@ -951,7 +950,6 @@ DCB* dcb_accept(const SListener& listener) // client address client_dcb->ip.ss_family = AF_UNIX; client_dcb->remote = MXS_STRDUP_A("localhost"); - client_dcb->path = MXS_STRDUP_A(listener->address()); } else { @@ -976,9 +974,6 @@ DCB* dcb_accept(const SListener& listener) } } - client_dcb->func = listener->protocol_func(); - client_dcb->authfunc = listener->auth_func(); - /** Allocate DCB specific authentication data */ if (client_dcb->authfunc.create && (client_dcb->authenticator_data = diff --git a/server/modules/authenticator/MySQLAuth/mysql_auth.cc b/server/modules/authenticator/MySQLAuth/mysql_auth.cc index 3120ece78..6de97b521 100644 --- a/server/modules/authenticator/MySQLAuth/mysql_auth.cc +++ b/server/modules/authenticator/MySQLAuth/mysql_auth.cc @@ -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)