Fix processBulKReply against TCP fragmentation.

see http://github.com/xetorthio/jedis/issues#issue/10
This commit is contained in:
Thomas Sauzedde
2010-09-10 23:05:18 +08:00
committed by Jonathan Leibiusky
parent 562fa70a0c
commit de5030e13f

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();