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

Function clusterNodeIsInGossipSection

src/cluster.cpp:2567–2574  ·  view source on GitHub ↗

Return non zero if the node is already present in the gossip section of the * message pointed by 'hdr' and having 'count' gossip entries. Otherwise * zero is returned. Helper for clusterSendPing(). */

Source from the content-addressed store, hash-verified

2565 * message pointed by 'hdr' and having 'count' gossip entries. Otherwise
2566 * zero is returned. Helper for clusterSendPing(). */
2567int clusterNodeIsInGossipSection(clusterMsg *hdr, int count, clusterNode *n) {
2568 int j;
2569 for (j = 0; j < count; j++) {
2570 if (memcmp(hdr->data.ping.gossip[j].nodename,n->name,
2571 CLUSTER_NAMELEN) == 0) break;
2572 }
2573 return j != count;
2574}
2575
2576/* Set the i-th entry of the gossip section in the message pointed by 'hdr'
2577 * to the info of the specified node 'n'. */

Callers 1

clusterSendPingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected