mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Fix automatic reconnect (e.g. on bad auth key)
This took more time than it should have to debug.
This commit is contained in:
@@ -14,6 +14,10 @@ class ConnectionTcpFull(Connection):
|
||||
super().__init__(ip, port, loop=loop)
|
||||
self._send_counter = 0
|
||||
|
||||
async def connect(self):
|
||||
await super().connect()
|
||||
self._send_counter = 0 # Important or Telegram won't reply
|
||||
|
||||
def _send(self, data):
|
||||
# https://core.telegram.org/mtproto#tcp-transport
|
||||
# total length, sequence number, packet and checksum (CRC32)
|
||||
|
Reference in New Issue
Block a user