Fix processBulKReply against TCP fragmentation.
see http://github.com/xetorthio/jedis/issues#issue/10
This commit is contained in:
@@ -139,8 +139,11 @@ public class Protocol {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
byte[] read = new byte[len];
|
byte[] read = new byte[len];
|
||||||
|
int offset = 0;
|
||||||
try {
|
try {
|
||||||
is.read(read);
|
while(offset < len) {
|
||||||
|
offset += is.read(read, offset, (len - offset));
|
||||||
|
}
|
||||||
// read 2 more bytes for the command delimiter
|
// read 2 more bytes for the command delimiter
|
||||||
is.read();
|
is.read();
|
||||||
is.read();
|
is.read();
|
||||||
|
|||||||
Reference in New Issue
Block a user