| 688 | } |
| 689 | |
| 690 | static 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 |
| 715 | void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { |
nothing calls this directly
no test coverage detected