gateway.c

file_write_footer, added checks for the case of failed memory allocation. 

service.c
	serviceRestart, added check for return value of poll_add_dcb. In failure, service is not moved to SESSION_STATE_LISTENER state and listener counter is not increased.
This commit is contained in:
vraatikka
2013-10-16 17:13:50 +03:00
parent 76af245eac
commit a696e041e0
2 changed files with 23 additions and 12 deletions

View File

@ -273,10 +273,10 @@ int listeners = 0;
port = service->ports;
while (port)
{
poll_add_dcb(port->listener);
port->listener->session->state = SESSION_STATE_LISTENER;
listeners++;
if (poll_add_dcb(port->listener) == 0) {
port->listener->session->state = SESSION_STATE_LISTENER;
listeners++;
}
port = port->next;
}