Commit 52a7d9c1 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed bug with timeouted calls.

parent b2ccb368
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -92,6 +92,19 @@ class ConnectionManager(object):
        if not already_completed:
            waiter['event'].wait(timeout=timeout)

        # Clean the call list on each attached RpcConnection
        for connection in self.all_connections():
            connection.clean_all_calls(msg_id_set)
        
        # Get the messages:
        messages = []

        for msg_id, msg in self._received_msg.items():
            if msg_id in msg_id_set:
                messages.append(msg)
                del self._received_msg[msg_id]
        waiter['responses'] = tuple(messages)

        messages = waiter['responses']
        del self._wait_groups[msg_id_set]

@@ -130,19 +143,6 @@ class ConnectionManager(object):
                  or not waiter['wait_all'] and not recv_msg.isdisjoint(waitset))

        if is_ok:
            # Clean the call list on each attached RpcConnection
            for connection in self.all_connections():
                connection.clean_all_calls(waitset)
            
            # Get the messages:
            messages = []

            for msg_id, msg in self._received_msg.items():
                if msg_id in waitset:
                    messages.append(msg)
                    del self._received_msg[msg_id]
            waiter['responses'] = tuple(messages)

            # Unlock the event:
            waiter['event'].set()