]> git.saurik.com Git - redis.git/commitdiff
disconnect when we cannot read from the socket
authorLudovico Magnocavallo <ludo@ankh.qix.it>
Mon, 11 May 2009 11:39:59 +0000 (13:39 +0200)
committerLudovico Magnocavallo <ludo@ankh.qix.it>
Mon, 11 May 2009 11:39:59 +0000 (13:39 +0200)
client-libraries/python/redis.py

index 881dfd1de7d4394cc06538ce3f98e85bcf16a765..1787f171b4c48dff369575ae93aba32f6a41d174 100644 (file)
@@ -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:])