summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--redis/connection.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 64797b2..ffd5cae 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
* 2.4.6 (in development)
* Variadic arguments for SADD, SREM, ZREN, HDEL, LPUSH, and RPUSH. Thanks
Raphaƫl Vinot.
+ * Fix for #153, only check for \n rather than \r\n.
* 2.4.5
* The PythonParser now works better when reading zero length strings.
* 2.4.4
diff --git a/redis/connection.py b/redis/connection.py
index 2b48e32..ff7f277 100644
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -89,9 +89,9 @@ class HiredisParser(object):
if not buffer:
raise ConnectionError("Socket closed on remote end")
self._reader.feed(buffer)
- # if the data received doesn't end with \r\n, then there's more in
- # the socket
- if not buffer.endswith('\r\n'):
+ # proactively, but not conclusively, check if more data is in the
+ # buffer. if the data received doesn't end with \n, there's more.
+ if not buffer.endswith('\n'):
continue
response = self._reader.gets()
return response