mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
disconnect when we cannot read from the socket
This commit is contained in:
parent
ecfaf6da92
commit
b062edf392
@ -880,6 +880,9 @@ class Redis(object):
|
|||||||
|
|
||||||
def get_response(self):
|
def get_response(self):
|
||||||
data = self._read().strip()
|
data = self._read().strip()
|
||||||
|
if not data:
|
||||||
|
self.disconnect()
|
||||||
|
raise ConnectionError("Socket closed on remote end")
|
||||||
c = data[0]
|
c = data[0]
|
||||||
if c == '-':
|
if c == '-':
|
||||||
raise ResponseError(data[5:] if data[:5] == '-ERR ' else data[1:])
|
raise ResponseError(data[5:] if data[:5] == '-ERR ' else data[1:])
|
||||||
|
Loading…
Reference in New Issue
Block a user