mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-03 19:00:21 +03:00
Workaround msg_seqno too low/high (closes #95)
This commit is contained in:
parent
151e1623d3
commit
12a39873f1
|
@ -306,6 +306,15 @@ class MtProtoSender:
|
||||||
self._logger.debug('Read Bad Message error: ' + str(error))
|
self._logger.debug('Read Bad Message error: ' + str(error))
|
||||||
self._logger.debug('Attempting to use the correct time offset.')
|
self._logger.debug('Attempting to use the correct time offset.')
|
||||||
return True
|
return True
|
||||||
|
elif error_code == 32:
|
||||||
|
# msg_seqno too low, so just pump it up by some "large" amount
|
||||||
|
# TODO A better fix would be to start with a new fresh session ID
|
||||||
|
self.session._sequence += 64
|
||||||
|
return True
|
||||||
|
elif error_code == 33:
|
||||||
|
# msg_seqno too high never seems to happen but just in case
|
||||||
|
self.session._sequence -= 16
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user