summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rwxr-xr-xredis/connection.py9
2 files changed, 4 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index f7060b6..44c17df 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,10 @@
to the master when the connection pool resets. Thanks
https://github.com/df3n5
* Better timeout support in Pubsub get_message. Thanks Andy Isaacson.
+ * Fixed a bug with the HiredisParser that would cause the parser to
+ get stuck in an endless loop if a specific number of bytes were
+ delivered from the socket. This fix also increases performance of
+ parsing large responses from the Redis server.
* 2.10.3
* Fixed a bug with the bytearray support introduced in 2.10.2. Thanks
Josh Owen.
diff --git a/redis/connection.py b/redis/connection.py
index 0229d28..19d6925 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -346,15 +346,6 @@ class HiredisParser(BaseParser):
self._reader.feed(self._buffer, 0, bufflen)
else:
self._reader.feed(buffer)
- # proactively, but not conclusively, check if more data is in the
- # buffer. if the data received doesn't end with \r\n, there's more.
- if HIREDIS_USE_BYTE_BUFFER:
- if bufflen > 2 and \
- self._buffer[bufflen - 2:bufflen] != SYM_CRLF:
- continue
- else:
- if not buffer.endswith(SYM_CRLF):
- continue
response = self._reader.gets()
# if an older version of hiredis is installed, we need to attempt
# to convert ResponseErrors to their appropriate types.