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

Fixed bug with ssl error handling.

parent e7697c16
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -122,11 +122,12 @@ class RpcConnection(object):
        try:
            buf = self._sock.recv(RpcConnection.RECV_BUF_SIZE)
        except socket.error as err:
            if err.errno == 11:
                # Errno 11 -> retry again
                logging.debug('Non critical error while reading a socket:'
                                ' %r', err)
            if isinstance(err, socket.error) and err.errno == 11:
                return
            elif isinstance(err, ssl.SSLError) and err.errno == 2:
                return
            else:
                raise err

        if not buf:
            # Empty buffer = closed socket.