MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / acceptUnixHandler

Function acceptUnixHandler

src/networking.cpp:1435–1453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1433}
1434
1435void acceptUnixHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
1436 int cfd, max = MAX_ACCEPTS_PER_CALL;
1437 UNUSED(el);
1438 UNUSED(mask);
1439 UNUSED(privdata);
1440
1441 while(max--) {
1442 cfd = anetUnixAccept(serverTL->neterr, fd);
1443 if (cfd == ANET_ERR) {
1444 if (errno != EWOULDBLOCK)
1445 serverLog(LL_WARNING,
1446 "Accepting client connection: %s", serverTL->neterr);
1447 return;
1448 }
1449 anetCloexec(cfd);
1450 serverLog(LL_VERBOSE,"Accepted connection to %s", g_pserver->unixsocket);
1451 acceptOnThread(connCreateAcceptedSocket(cfd),CLIENT_UNIX_SOCKET,NULL);
1452 }
1453}
1454
1455void freeClientOriginalArgv(client *c) {
1456 /* We didn't rewrite this client */

Callers

nothing calls this directly

Calls 5

anetUnixAcceptFunction · 0.85
serverLogFunction · 0.85
anetCloexecFunction · 0.85
acceptOnThreadFunction · 0.85
connCreateAcceptedSocketFunction · 0.85

Tested by

no test coverage detected