Commit 3e35e5ed authored by Antoine Millet's avatar Antoine Millet

Fixed bug with ssl error handling.

parent e7697c16
...@@ -122,11 +122,12 @@ class RpcConnection(object): ...@@ -122,11 +122,12 @@ class RpcConnection(object):
try: try:
buf = self._sock.recv(RpcConnection.RECV_BUF_SIZE) buf = self._sock.recv(RpcConnection.RECV_BUF_SIZE)
except socket.error as err: except socket.error as err:
if err.errno == 11: if isinstance(err, socket.error) and err.errno == 11:
# Errno 11 -> retry again
logging.debug('Non critical error while reading a socket:'
' %r', err)
return return
elif isinstance(err, ssl.SSLError) and err.errno == 2:
return
else:
raise err
if not buf: if not buf:
# Empty buffer = closed socket. # Empty buffer = closed socket.
......
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