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

Function clusterSetGossipEntry

src/cluster.cpp:2578–2590  ·  view source on GitHub ↗

Set the i-th entry of the gossip section in the message pointed by 'hdr' * to the info of the specified node 'n'. */

Source from the content-addressed store, hash-verified

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'. */
2578void clusterSetGossipEntry(clusterMsg *hdr, int i, clusterNode *n) {
2579 clusterMsgDataGossip *gossip;
2580 gossip = &(hdr->data.ping.gossip[i]);
2581 memcpy(gossip->nodename,n->name,CLUSTER_NAMELEN);
2582 gossip->ping_sent = htonl(n->ping_sent/1000);
2583 gossip->pong_received = htonl(n->pong_received/1000);
2584 memcpy(gossip->ip,n->ip,sizeof(n->ip));
2585 gossip->port = htons(n->port);
2586 gossip->cport = htons(n->cport);
2587 gossip->flags = htons(n->flags);
2588 gossip->pport = htons(n->pport);
2589 gossip->notused1 = 0;
2590}
2591
2592/* Send a PING or PONG packet to the specified node, making sure to add enough
2593 * gossip information. */

Callers 1

clusterSendPingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected