Commit 251078ed authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed bug with shutdown on RpcProtocol.

parent 3b5bd3f9
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -55,16 +55,10 @@ class RpcProtocol(object):

    def shutdown(self):
        # Release all waiting calls from this rpc:
        for cid, call in self._calls.iteritems():
        for cid in self._calls:
            err = {'exception': 'RpcError',
                   'message': 'Connection reset by peer'}
            if 'event' in call:
                call['error'] = err
                call['return'] = None
                call['event'].set()
            else:
                msg = {'id': cid, 'error': err, 'return': None}
                self._manager.signal_arrival(msg)
            self._handle_response({'id': cid, 'return': None, 'error': err})

        # Execute on_disconnect callback:
        callback = None