Fix ack requests removing pending requests when they shouldn't

This commit is contained in:
Lonami Exo 2017-09-03 11:21:42 +02:00
parent db6fd4bdc2
commit f8f389c850

View File

@ -204,13 +204,13 @@ class MtProtoSender:
# msgs_ack, it may handle the request we wanted # msgs_ack, it may handle the request we wanted
if code == 0x62d6b459: if code == 0x62d6b459:
ack = reader.tgread_object() ack = reader.tgread_object()
for msg_id in ack.msg_ids: for r in self._pending_receive:
r = self._pop_request(msg_id) if r.request_msg_id in ack.msg_ids:
if r:
self._logger.debug('Ack found for the a request') self._logger.debug('Ack found for the a request')
if self.logging_out: if self.logging_out:
self._logger.debug('Message ack confirmed a request') self._logger.debug('Message ack confirmed a request')
self._pending_receive.remove(r)
r.confirm_received.set() r.confirm_received.set()
return True return True