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

Function clusterConnAcceptHandler

app/redis-6.2.6/src/cluster.c:652–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652static void clusterConnAcceptHandler(connection *conn) {
653 clusterLink *link;
654
655 if (connGetState(conn) != CONN_STATE_CONNECTED) {
656 serverLog(LL_VERBOSE,
657 "Error accepting cluster node connection: %s", connGetLastError(conn));
658 connClose(conn);
659 return;
660 }
661
662 /* Create a link object we use to handle the connection.
663 * It gets passed to the readable handler when data is available.
664 * Initially the link->node pointer is set to NULL as we don't know
665 * which node is, but the right node is references once we know the
666 * node identity. */
667 link = createClusterLink(NULL);
668 link->conn = conn;
669 connSetPrivateData(conn, link);
670
671 /* Register read handler */
672 connSetReadHandler(conn, clusterReadHandler);
673}
674
675#define MAX_CLUSTER_ACCEPTS_PER_CALL 1000
676void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {

Callers

nothing calls this directly

Calls 6

connGetStateFunction · 0.85
connGetLastErrorFunction · 0.85
connCloseFunction · 0.85
createClusterLinkFunction · 0.85
connSetPrivateDataFunction · 0.85
connSetReadHandlerFunction · 0.85

Tested by

no test coverage detected