| 2736 | #define CLUSTER_BROADCAST_ALL 0 |
| 2737 | #define CLUSTER_BROADCAST_LOCAL_SLAVES 1 |
| 2738 | void clusterBroadcastPong(int target) { |
| 2739 | dictIterator *di; |
| 2740 | dictEntry *de; |
| 2741 | |
| 2742 | di = dictGetSafeIterator(g_pserver->cluster->nodes); |
| 2743 | while((de = dictNext(di)) != NULL) { |
| 2744 | clusterNode *node = (clusterNode*)dictGetVal(de); |
| 2745 | |
| 2746 | if (!node->link) continue; |
| 2747 | if (node == myself || nodeInHandshake(node)) continue; |
| 2748 | if (target == CLUSTER_BROADCAST_LOCAL_SLAVES) { |
| 2749 | int local_slave = |
| 2750 | nodeIsSlave(node) && node->slaveof && |
| 2751 | (node->slaveof == myself || node->slaveof == myself->slaveof); |
| 2752 | if (!local_slave) continue; |
| 2753 | } |
| 2754 | clusterSendPing(node->link,CLUSTERMSG_TYPE_PONG); |
| 2755 | } |
| 2756 | dictReleaseIterator(di); |
| 2757 | } |
| 2758 | |
| 2759 | /* Send a PUBLISH message. |
| 2760 | * |
no test coverage detected