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

Function clusterConnAcceptHandler

src/cluster.cpp:690–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690static void clusterConnAcceptHandler(connection *conn) {
691 serverAssert(ielFromEventLoop(serverTL->el) == IDX_EVENT_LOOP_MAIN);
692 clusterLink *link;
693
694 if (connGetState(conn) != CONN_STATE_CONNECTED) {
695 serverLog(LL_VERBOSE,
696 "Error accepting cluster node connection: %s", connGetLastError(conn));
697 connClose(conn);
698 return;
699 }
700
701 /* Create a link object we use to handle the connection.
702 * It gets passed to the readable handler when data is available.
703 * Initially the link->node pointer is set to NULL as we don't know
704 * which node is, but the right node is references once we know the
705 * node identity. */
706 link = createClusterLink(NULL);
707 link->conn = conn;
708 connSetPrivateData(conn, link);
709
710 /* Register read handler */
711 connSetReadHandler(conn, clusterReadHandler);
712}
713
714#define MAX_CLUSTER_ACCEPTS_PER_CALL 1000
715void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected