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:
@ -50,7 +50,6 @@ static int cdc_error(DCB* dcb);
|
||||
static int cdc_hangup(DCB* dcb);
|
||||
static int cdc_accept(DCB* dcb);
|
||||
static int cdc_close(DCB* dcb);
|
||||
static int cdc_listen(DCB* dcb, char* config);
|
||||
static CDC_protocol* cdc_protocol_init(DCB* dcb);
|
||||
static void cdc_protocol_done(DCB* dcb);
|
||||
static int do_auth(DCB* dcb, GWBUF* buffer, void* data);
|
||||
@ -84,7 +83,6 @@ extern "C"
|
||||
cdc_accept, /* Accept */
|
||||
NULL, /* Connect */
|
||||
cdc_close, /* Close */
|
||||
cdc_listen, /* Create a listener */
|
||||
NULL, /* Authentication */
|
||||
cdc_default_auth, /* default authentication */
|
||||
NULL,
|
||||
@ -359,17 +357,6 @@ static int cdc_close(DCB* dcb)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* CDC protocol listener entry point
|
||||
*
|
||||
* @param listener The Listener DCB
|
||||
* @param config Configuration (ip:port)
|
||||
*/
|
||||
static int cdc_listen(DCB* listener, char* config)
|
||||
{
|
||||
return (dcb_listen(listener, config, "CDC") < 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate a new CDC protocol structure
|
||||
*
|
||||
|
@ -52,7 +52,6 @@ static int httpd_error(DCB* dcb);
|
||||
static int httpd_hangup(DCB* dcb);
|
||||
static int httpd_accept(DCB* dcb);
|
||||
static int httpd_close(DCB* dcb);
|
||||
static int httpd_listen(DCB* dcb, char* config);
|
||||
static int httpd_get_line(int sock, char* buf, int size);
|
||||
static void httpd_send_headers(DCB* dcb, int final, bool auth_ok);
|
||||
static char* httpd_default_auth();
|
||||
@ -79,7 +78,6 @@ extern "C"
|
||||
httpd_accept, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
httpd_close, /**< Close */
|
||||
httpd_listen, /**< Create a listener */
|
||||
NULL, /**< Authentication */
|
||||
httpd_default_auth, /**< Default authenticator */
|
||||
NULL, /**< Connection limit reached */
|
||||
@ -401,17 +399,6 @@ static int httpd_close(DCB* dcb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTTP daemon listener entry point
|
||||
*
|
||||
* @param listener The Listener DCB
|
||||
* @param config Configuration (ip:port)
|
||||
*/
|
||||
static int httpd_listen(DCB* listener, char* config)
|
||||
{
|
||||
return (dcb_listen(listener, config, "HTTPD") < 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTPD get line from client
|
||||
*/
|
||||
|
@ -84,7 +84,6 @@ extern "C"
|
||||
NULL, /* Accept */
|
||||
gw_create_backend_connection, /* Connect */
|
||||
gw_backend_close, /* Close */
|
||||
NULL, /* Listen */
|
||||
gw_change_user, /* Authentication */
|
||||
gw_backend_default_auth, /* Default authenticator */
|
||||
NULL, /* Connection limit reached */
|
||||
|
@ -59,7 +59,6 @@ static int thread_init(void);
|
||||
static void thread_finish(void);
|
||||
|
||||
static int gw_MySQLAccept(DCB* listener);
|
||||
static int gw_MySQLListener(DCB* listener, char* config_bind);
|
||||
static int gw_read_client_event(DCB* dcb);
|
||||
static int gw_write_client_event(DCB* dcb);
|
||||
static int gw_MySQLWrite_client(DCB* dcb, GWBUF* queue);
|
||||
@ -107,7 +106,6 @@ extern "C"
|
||||
gw_MySQLAccept, /* Accept */
|
||||
NULL, /* Connect */
|
||||
gw_client_close, /* Close */
|
||||
gw_MySQLListener, /* Listen */
|
||||
NULL, /* Authentication */
|
||||
gw_default_auth, /* Default authenticator */
|
||||
gw_connection_limit, /* Send error connection limit */
|
||||
@ -1384,25 +1382,6 @@ return_1:
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind the DCB to a network port or a UNIX Domain Socket.
|
||||
* @param listen_dcb Listener DCB
|
||||
* @param config_bind Bind address in either IP:PORT format for network sockets or PATH
|
||||
* for UNIX Domain Sockets
|
||||
* @return 1 on success, 0 on error
|
||||
*/
|
||||
int gw_MySQLListener(DCB* listen_dcb, char* config_bind)
|
||||
{
|
||||
if (dcb_listen(listen_dcb, config_bind, "MySQL") < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
listen_dcb->func.accept = gw_MySQLAccept;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @node Accept a new connection, using the DCB code for the basic work
|
||||
*
|
||||
|
@ -63,7 +63,6 @@ static int maxscaled_error(DCB* dcb);
|
||||
static int maxscaled_hangup(DCB* dcb);
|
||||
static int maxscaled_accept(DCB* dcb);
|
||||
static int maxscaled_close(DCB* dcb);
|
||||
static int maxscaled_listen(DCB* dcb, char* config);
|
||||
static char* mxsd_default_auth();
|
||||
|
||||
static bool authenticate_unix_socket(MAXSCALED* protocol, DCB* dcb)
|
||||
@ -181,7 +180,6 @@ extern "C"
|
||||
maxscaled_accept, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
maxscaled_close, /**< Close */
|
||||
maxscaled_listen, /**< Create a listener */
|
||||
NULL, /**< Authentication */
|
||||
mxsd_default_auth, /**< Default authenticator */
|
||||
NULL, /**< Connection limit reached */
|
||||
@ -417,27 +415,3 @@ static int maxscaled_close(DCB* dcb)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maxscale daemon listener entry point
|
||||
*
|
||||
* @param listener The Listener DCB
|
||||
* @param config Configuration (ip:port)
|
||||
* @return 0 on failure, 1 on success
|
||||
*/
|
||||
static int maxscaled_listen(DCB* listener, char* config)
|
||||
{
|
||||
const char* socket_path = NULL;
|
||||
|
||||
/* check for default UNIX socket */
|
||||
if (strncmp(config, MAXADMIN_CONFIG_DEFAULT_SOCKET_TAG, MAXADMIN_CONFIG_DEFAULT_SOCKET_TAG_LEN) == 0)
|
||||
{
|
||||
socket_path = MAXADMIN_DEFAULT_SOCKET;
|
||||
}
|
||||
else
|
||||
{
|
||||
socket_path = config;
|
||||
}
|
||||
|
||||
return (dcb_listen(listener, socket_path, "MaxScale Admin") < 0) ? 0 : 1;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ static int telnetd_error(DCB* dcb);
|
||||
static int telnetd_hangup(DCB* dcb);
|
||||
static int telnetd_accept(DCB* dcb);
|
||||
static int telnetd_close(DCB* dcb);
|
||||
static int telnetd_listen(DCB* dcb, char* config);
|
||||
static char* telnetd_default_auth();
|
||||
|
||||
/**
|
||||
@ -100,7 +99,6 @@ extern "C"
|
||||
telnetd_accept, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
telnetd_close, /**< Close */
|
||||
telnetd_listen, /**< Create a listener */
|
||||
NULL, /**< Authentication */
|
||||
telnetd_default_auth, /**< Default authenticator */
|
||||
NULL, /**< Connection limit reached */
|
||||
@ -330,17 +328,6 @@ static int telnetd_close(DCB* dcb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Telnet daemon listener entry point
|
||||
*
|
||||
* @param listener The Listener DCB
|
||||
* @param config Configuration (ip:port)
|
||||
*/
|
||||
static int telnetd_listen(DCB* listener, char* config)
|
||||
{
|
||||
return (dcb_listen(listener, config, "telnet") < 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Telnet command implementation
|
||||
*
|
||||
|
Reference in New Issue
Block a user