Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
90e99a20
Commit
90e99a20
authored
Mar 14, 2013
by
antirez
Browse files
Cluster: two lame bugs fixed in FAILOVER AUTH messages generation.
parent
aeacaa57
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
90e99a20
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment