Fix processBulKReply against TCP fragmentation.
see http://github.com/xetorthio/jedis/issues#issue/10
This commit is contained in:
committed by
Jonathan Leibiusky
parent
562fa70a0c
commit
de5030e13f
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user