提交 f6efb6cd 编写于 作者: A antirez

Cluster: fixed a bug in clusterSendPublish() due to inverted statements.

The code used to copy the header *after* the 'hdr' pointer was already
switched to the new buffer. Of course we need to do the reverse.
上级 e9d97b45
......@@ -1380,8 +1380,8 @@ void clusterSendPublish(clusterLink *link, robj *channel, robj *message) {
payload = buf;
} else {
payload = zmalloc(totlen);
hdr = (clusterMsg*) payload;
memcpy(payload,hdr,sizeof(*hdr));
hdr = (clusterMsg*) payload;
}
memcpy(hdr->data.publish.msg.bulk_data,channel->ptr,sdslen(channel->ptr));
memcpy(hdr->data.publish.msg.bulk_data+sdslen(channel->ptr),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册