MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clusterSetGossipEntry

Function clusterSetGossipEntry

app/redis-6.2.6/src/cluster.c:2520–2532  ·  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

2518/* Set the i-th entry of the gossip section in the message pointed by 'hdr'
2519 * to the info of the specified node 'n'. */
2520void clusterSetGossipEntry(clusterMsg *hdr, int i, clusterNode *n) {
2521 clusterMsgDataGossip *gossip;
2522 gossip = &(hdr->data.ping.gossip[i]);
2523 memcpy(gossip->nodename,n->name,CLUSTER_NAMELEN);
2524 gossip->ping_sent = htonl(n->ping_sent/1000);
2525 gossip->pong_received = htonl(n->pong_received/1000);
2526 memcpy(gossip->ip,n->ip,sizeof(n->ip));
2527 gossip->port = htons(n->port);
2528 gossip->cport = htons(n->cport);
2529 gossip->flags = htons(n->flags);
2530 gossip->pport = htons(n->pport);
2531 gossip->notused1 = 0;
2532}
2533
2534/* Send a PING or PONG packet to the specified node, making sure to add enough
2535 * gossip information. */

Callers 1

clusterSendPingFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected