| 2678 | #define CLUSTER_BROADCAST_ALL 0 |
| 2679 | #define CLUSTER_BROADCAST_LOCAL_SLAVES 1 |
| 2680 | void clusterBroadcastPong(int target) { |
| 2681 | dictIterator *di; |
| 2682 | dictEntry *de; |
| 2683 | |
| 2684 | di = dictGetSafeIterator(server.cluster->nodes); |
| 2685 | while((de = dictNext(di)) != NULL) { |
| 2686 | clusterNode *node = dictGetVal(de); |
| 2687 | |
| 2688 | if (!node->link) continue; |
| 2689 | if (node == myself || nodeInHandshake(node)) continue; |
| 2690 | if (target == CLUSTER_BROADCAST_LOCAL_SLAVES) { |
| 2691 | int local_slave = |
| 2692 | nodeIsSlave(node) && node->slaveof && |
| 2693 | (node->slaveof == myself || node->slaveof == myself->slaveof); |
| 2694 | if (!local_slave) continue; |
| 2695 | } |
| 2696 | clusterSendPing(node->link,CLUSTERMSG_TYPE_PONG); |
| 2697 | } |
| 2698 | dictReleaseIterator(di); |
| 2699 | } |
| 2700 | |
| 2701 | /* Send a PUBLISH message. |
| 2702 | * |
no test coverage detected