Free the clients marked as CLOSE_ASAP, return the number of clients * freed. */
| 1467 | /* Free the clients marked as CLOSE_ASAP, return the number of clients |
| 1468 | * freed. */ |
| 1469 | int freeClientsInAsyncFreeQueue(void) { |
| 1470 | int freed = 0; |
| 1471 | listIter li; |
| 1472 | listNode *ln; |
| 1473 | |
| 1474 | listRewind(server.clients_to_close,&li); |
| 1475 | while ((ln = listNext(&li)) != NULL) { |
| 1476 | client *c = listNodeValue(ln); |
| 1477 | |
| 1478 | if (c->flags & CLIENT_PROTECTED) continue; |
| 1479 | |
| 1480 | c->flags &= ~CLIENT_CLOSE_ASAP; |
| 1481 | freeClient(c); |
| 1482 | listDelNode(server.clients_to_close,ln); |
| 1483 | freed++; |
| 1484 | } |
| 1485 | return freed; |
| 1486 | } |
| 1487 | |
| 1488 | /* Return a client by ID, or NULL if the client ID is not in the set |
| 1489 | * of registered clients. Note that "fake clients", created with -1 as FD, |
no test coverage detected