MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freeClientsInAsyncFreeQueue

Function freeClientsInAsyncFreeQueue

app/redis-6.2.6/src/networking.c:1469–1486  ·  view source on GitHub ↗

Free the clients marked as CLOSE_ASAP, return the number of clients * freed. */

Source from the content-addressed store, hash-verified

1467/* Free the clients marked as CLOSE_ASAP, return the number of clients
1468 * freed. */
1469int 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,

Callers 1

beforeSleepFunction · 0.85

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
listDelNodeFunction · 0.85
freeClientFunction · 0.70

Tested by

no test coverage detected