| 650 | } |
| 651 | |
| 652 | static 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 |
| 676 | void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { |
nothing calls this directly
no test coverage detected