Merge branch 'handles-client-output-buffer-limit' of github.com:HeartSaVioR/jedis into HeartSaVioR-handles-client-output-buffer-limit

This commit is contained in:
Jonathan Leibiusky
2013-12-03 07:41:07 -05:00
3 changed files with 75 additions and 1 deletions

View File

@@ -100,7 +100,10 @@ public final class Protocol {
int offset = 0;
try {
while (offset < len) {
offset += is.read(read, offset, (len - offset));
int size = is.read(read, offset, (len - offset));
if (size == -1)
throw new JedisConnectionException("It seems like server has closed the connection.");
offset += size;
}
// read 2 more bytes for the command delimiter
is.readByte();