mirror of
https://github.com/fluencelabs/redis
synced 2025-06-14 09:41:21 +00:00
Fixed replication when multiple slaves are attaching at the same time. The output buffer was not copied correctly between slaves. This fixes issue #141.
This commit is contained in:
@ -401,6 +401,16 @@ void addReplyBulkLongLong(redisClient *c, long long ll) {
|
||||
addReplyBulkCBuffer(c,buf,len);
|
||||
}
|
||||
|
||||
/* Copy 'src' client output buffers into 'dst' client output buffers.
|
||||
* The function takes care of freeing the old output buffers of the
|
||||
* destination client. */
|
||||
void copyClientOutputBuffer(redisClient *dst, redisClient *src) {
|
||||
listRelease(dst->reply);
|
||||
dst->reply = listDup(src->reply);
|
||||
memcpy(dst->buf,src->buf,src->bufpos);
|
||||
dst->bufpos = src->bufpos;
|
||||
}
|
||||
|
||||
static void acceptCommonHandler(int fd) {
|
||||
redisClient *c;
|
||||
if ((c = createClient(fd)) == NULL) {
|
||||
|
Reference in New Issue
Block a user