ServiceStop only removed DCBs from the polling system

This removes the need to establish new DCBs for each of the listeners while still blocking new session creation
for a service which is shut down. The client will not receive an error and the connection will be accepted
when the service is restarted.
This commit is contained in:
Markus Makela
2015-06-23 09:15:06 +03:00
parent e14b29baf9
commit c22c6ea46a

View File

@ -534,12 +534,8 @@ int listeners = 0;
port = service->ports;
while (port)
{
if(port->listener)
{
dcb_close(port->listener);
port->listener = NULL;
if(poll_remove_dcb(port->listener) == 0)
listeners++;
}
port = port->next;
}
service->state = SERVICE_STATE_STOPPED;
@ -564,7 +560,8 @@ int listeners = 0;
port = service->ports;
while (port)
{
listeners += serviceStartPort(service,port);
if(poll_add_dcb(port->listener) == 0)
listeners++;
port = port->next;
}
service->state = SERVICE_STATE_STARTED;