The listener DCB is now properly closed instead of just being removed from the poll set.
This commit is contained in:
Markus Makela
2015-06-21 12:51:54 +03:00
parent 79c20bfae8
commit e14b29baf9
5 changed files with 23 additions and 14 deletions

View File

@ -1949,13 +1949,15 @@ dcb_close(DCB *dcb)
}
ss_dassert(dcb->state == DCB_STATE_POLLING ||
dcb->state == DCB_STATE_LISTENING ||
dcb->state == DCB_STATE_NOPOLLING ||
dcb->state == DCB_STATE_ZOMBIE);
/*<
* Stop dcb's listening and modify state accordingly.
*/
if (dcb->state == DCB_STATE_POLLING)
if (dcb->state == DCB_STATE_POLLING ||
dcb->state == DCB_STATE_LISTENING)
{
rc = poll_remove_dcb(dcb);
@ -2428,6 +2430,10 @@ static bool dcb_set_state_nomutex(
case DCB_STATE_POLLING: /*< ok to try but state can't change */
succp = true;
break;
case DCB_STATE_LISTENING:
dcb->state = new_state;
succp = true;
break;
default:
ss_dassert(old_state != NULL);
break;