MXS-2196: Remove unnecessary functions

The functions for starting listeners aren't needed as the listen method
can be called directly.
This commit is contained in:
Markus Mäkelä 2018-12-02 03:06:13 +02:00
parent 3df38bc887
commit 015c581a5b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 4 additions and 39 deletions

View File

@ -309,15 +309,6 @@ Service* service_internal_find(const char* name);
*/
bool serviceHasBackend(Service* service, SERVER* server);
/**
* @brief Start new a listener for a service
*
* @param service Service where the listener is linked
* @param port Listener to start
* @return True if listener was started
*/
bool serviceLaunchListener(Service* service, const SListener& port);
/**
* @brief Find listener with specified properties.
*

View File

@ -313,19 +313,6 @@ bool service_isvalid(Service* service)
service) != this_unit.services.end();
}
/**
* Start an individual port/protocol pair
*
* @param service The service
* @param port The port to start
* @return The number of listeners started
*/
static int serviceStartPort(Service* service, const SListener& port)
{
mxb_assert(service && service->router && service->router_instance);
return port->listen();
}
/**
* Start all ports for a service.
* serviceStartAllPorts will try to start all listeners associated with the service.
@ -348,7 +335,10 @@ int serviceStartAllPorts(Service* service)
break;
}
listeners += serviceStartPort(service, listener);
if (listener->listen())
{
++listeners;
}
}
if (service->state == SERVICE_STATE_FAILED)
@ -420,22 +410,6 @@ int serviceInitialize(Service* service)
return listeners;
}
bool serviceLaunchListener(Service* service, const SListener& port)
{
mxb_assert(service->state != SERVICE_STATE_FAILED);
bool rval = true;
LockGuard guard(service->lock);
if (serviceStartPort(service, port) == 0)
{
/** Failed to start the listener */
rval = false;
}
return rval;
}
bool serviceStopListener(SERVICE* svc, const char* name)
{
auto listener = listener_find(name);