提交 90e99a20 编写于 作者: A antirez

Cluster: two lame bugs fixed in FAILOVER AUTH messages generation.

上级 aeacaa57
...@@ -1271,19 +1271,19 @@ void clusterPropagatePublish(robj *channel, robj *message) { ...@@ -1271,19 +1271,19 @@ void clusterPropagatePublish(robj *channel, robj *message) {
* Note that we send the failover request to everybody, master and slave nodes, * Note that we send the failover request to everybody, master and slave nodes,
* but only the masters are supposed to reply to our query. */ * but only the masters are supposed to reply to our query. */
void clusterRequestFailoverAuth(void) { void clusterRequestFailoverAuth(void) {
unsigned char buf[4096], *payload; unsigned char buf[4096];
clusterMsg *hdr = (clusterMsg*) buf; clusterMsg *hdr = (clusterMsg*) buf;
uint32_t totlen; uint32_t totlen;
clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST); clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST);
totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData); totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
hdr->totlen = htonl(totlen); hdr->totlen = htonl(totlen);
clusterBroadcastMessage(payload,totlen); clusterBroadcastMessage(buf,totlen);
} }
/* Send a FAILOVER_AUTH_ACK message to the specified node. */ /* Send a FAILOVER_AUTH_ACK message to the specified node. */
void clusterSendFailoverAuth(clusterNode *node) { void clusterSendFailoverAuth(clusterNode *node) {
unsigned char buf[4096], *payload; unsigned char buf[4096];
clusterMsg *hdr = (clusterMsg*) buf; clusterMsg *hdr = (clusterMsg*) buf;
uint32_t totlen; uint32_t totlen;
...@@ -1291,7 +1291,7 @@ void clusterSendFailoverAuth(clusterNode *node) { ...@@ -1291,7 +1291,7 @@ void clusterSendFailoverAuth(clusterNode *node) {
clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK); clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK);
totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData); totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
hdr->totlen = htonl(totlen); hdr->totlen = htonl(totlen);
clusterSendMessage(node->link,payload,totlen); clusterSendMessage(node->link,buf,totlen);
} }
/* If we believe 'node' is the "first slave" of it's master, reply with /* If we believe 'node' is the "first slave" of it's master, reply with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册