Fix processBulKReply against TCP fragmentation.

see http://github.com/xetorthio/jedis/issues#issue/10
This commit is contained in:
Thomas Sauzedde
2010-09-10 17:05:18 +02:00
parent 562fa70a0c
commit f0f6049cdb

View File

@@ -139,8 +139,11 @@ public class Protocol {
return null;
}
byte[] read = new byte[len];
int offset = 0;
try {
is.read(read);
while(offset < len) {
offset += is.read(read, offset, (len - offset));
}
// read 2 more bytes for the command delimiter
is.read();
is.read();