Commit 0381931b authored by antirez's avatar antirez
Browse files

Streams: Update listpack to fix 32bit strings encoding error.

Note that streams produced by XADD in previous broken versions having
elements with 4096 bytes or more will be permanently broken and must be
created again from scratch.

Fix #4428
Fix #4349
parent 020fe26b
......@@ -283,7 +283,7 @@ int lpEncodeGetType(unsigned char *ele, uint32_t size, unsigned char *intenc, ui
} else {
if (size < 64) *enclen = 1+size;
else if (size < 4096) *enclen = 2+size;
else *enclen = 4+size;
else *enclen = 5+size;
return LP_ENCODING_STRING;
}
}
......@@ -363,7 +363,7 @@ void lpEncodeString(unsigned char *buf, unsigned char *s, uint32_t len) {
buf[2] = (len >> 8) & 0xff;
buf[3] = (len >> 16) & 0xff;
buf[4] = (len >> 24) & 0xff;
memcpy(buf+4,s,len);
memcpy(buf+5,s,len);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment