Commit b062edf3 authored by Ludovico Magnocavallo's avatar Ludovico Magnocavallo
Browse files

disconnect when we cannot read from the socket

parent ecfaf6da
......@@ -880,6 +880,9 @@ class Redis(object):
def get_response(self):
data = self._read().strip()
if not data:
self.disconnect()
raise ConnectionError("Socket closed on remote end")
c = data[0]
if c == '-':
raise ResponseError(data[5:] if data[:5] == '-ERR ' else data[1:])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment