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

Function acceptTLSHandler

src/networking.cpp:1411–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1409}
1410
1411void acceptTLSHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
1412 int cport, cfd, max = MAX_ACCEPTS_PER_CALL_TLS;
1413 char cip[NET_IP_STR_LEN];
1414 UNUSED(el);
1415 UNUSED(mask);
1416 UNUSED(privdata);
1417
1418 while(max--) {
1419 cfd = anetTcpAccept(serverTL->neterr, fd, cip, sizeof(cip), &cport);
1420 if (cfd == ANET_ERR) {
1421 if (errno != EWOULDBLOCK)
1422 serverLog(LL_WARNING,
1423 "Accepting client connection: %s", serverTL->neterr);
1424 return;
1425 }
1426 anetCloexec(cfd);
1427 serverLog(LL_VERBOSE,"Accepted %s:%d", cip, cport);
1428
1429 acceptOnThread(connCreateAcceptedTLS(cfd, g_pserver->tls_auth_clients), 0, cip);
1430 if (aeLockContention() >= 2)
1431 break;
1432 }
1433}
1434
1435void acceptUnixHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
1436 int cfd, max = MAX_ACCEPTS_PER_CALL;

Callers

nothing calls this directly

Calls 6

anetTcpAcceptFunction · 0.85
serverLogFunction · 0.85
anetCloexecFunction · 0.85
acceptOnThreadFunction · 0.85
connCreateAcceptedTLSFunction · 0.85
aeLockContentionFunction · 0.85

Tested by

no test coverage detected