summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2011-07-10 20:33:15 -0700
committerAndy McCurdy <andy@andymccurdy.com>2011-07-10 20:33:15 -0700
commit24b0f17a80b51ed2d7f7e1ca139428f27bf642c9 (patch)
treec4e2f2175beb8a451b3edbaee01b2370195fa2a5 /redis/connection.py
parent194d29687dbb110d619b30274945832b2cab14d1 (diff)
downloadredis-py-24b0f17a80b51ed2d7f7e1ca139428f27bf642c9.tar.gz
Fix for #153, can only reliably check the last byte of the response
Diffstat (limited to 'redis/connection.py')
-rw-r--r--redis/connection.py6
1 files changed, 3 insertions, 3 deletions
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