Added missing NULL checks.
This commit is contained in:
@ -2423,6 +2423,9 @@ static bool dcb_set_state_nomutex(
|
||||
|
||||
case DCB_STATE_NOPOLLING:
|
||||
switch (new_state) {
|
||||
/** Stopped services which are restarting will go from
|
||||
* DCB_STATE_NOPOLLING to DCB_STATE_LISTENING.*/
|
||||
case DCB_STATE_LISTENING:
|
||||
case DCB_STATE_ZOMBIE: /*< fall through */
|
||||
dcb->state = new_state;
|
||||
case DCB_STATE_POLLING: /*< ok to try but state can't change */
|
||||
|
@ -534,10 +534,14 @@ int listeners = 0;
|
||||
port = service->ports;
|
||||
while (port)
|
||||
{
|
||||
if(port->listener && poll_remove_dcb(port->listener) == 0)
|
||||
if(port->listener &&
|
||||
port->listener->session->state == SESSION_STATE_LISTENER)
|
||||
{
|
||||
port->listener->session->state = SESSION_STATE_LISTENER_STOPPED;
|
||||
listeners++;
|
||||
if(poll_remove_dcb(port->listener) == 0)
|
||||
{
|
||||
port->listener->session->state = SESSION_STATE_LISTENER_STOPPED;
|
||||
listeners++;
|
||||
}
|
||||
}
|
||||
port = port->next;
|
||||
}
|
||||
@ -563,11 +567,15 @@ int listeners = 0;
|
||||
port = service->ports;
|
||||
while (port)
|
||||
{
|
||||
if(port->listener && poll_add_dcb(port->listener) == 0)
|
||||
if(port->listener &&
|
||||
port->listener->session->state == SESSION_STATE_LISTENER_STOPPED)
|
||||
{
|
||||
if(poll_add_dcb(port->listener) == 0)
|
||||
{
|
||||
port->listener->session->state = SESSION_STATE_LISTENER;
|
||||
listeners++;
|
||||
}
|
||||
}
|
||||
port = port->next;
|
||||
}
|
||||
service->state = SERVICE_STATE_STARTED;
|
||||
|
Reference in New Issue
Block a user