MXS-2196: Remove listen entry point from protocol

The entry point was useless as all of the modules called the same
function.
This commit is contained in:
Markus Mäkelä
2018-11-30 11:32:05 +02:00
parent ae3763da92
commit a6063b5e85
11 changed files with 21 additions and 107 deletions

View File

@ -2606,10 +2606,10 @@ static int dcb_accept_one_connection(DCB* dcb, struct sockaddr* client_conn)
*
* @param dcb Listener DCB that is being created
* @param config Configuration for port to listen on
* @param protocol_name Name of protocol that is listening
*
* @return 0 if new listener created successfully, otherwise -1
*/
int dcb_listen(DCB* dcb, const char* config, const char* protocol_name)
int dcb_listen(DCB* dcb, const char* config)
{
char host[strlen(config) + 1];
strcpy(host, config);
@ -2667,17 +2667,16 @@ int dcb_listen(DCB* dcb, const char* config, const char* protocol_name)
*/
if (listen(listener_socket, INT_MAX) != 0)
{
MXS_ERROR("Failed to start listening on [%s]:%u with protocol '%s': %d, %s",
MXS_ERROR("Failed to start listening on [%s]:%u: %d, %s",
host,
port,
protocol_name,
errno,
mxs_strerror(errno));
close(listener_socket);
return -1;
}
MXS_NOTICE("Listening for connections at [%s]:%u with protocol %s", host, port, protocol_name);
MXS_NOTICE("Listening for connections at [%s]:%u", host, port);
// assign listener_socket to dcb
dcb->fd = listener_socket;