mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Don't log broken packets as individual bytes
This commit is contained in:
parent
75d37a3870
commit
ace715e059
|
@ -191,10 +191,13 @@ class Connection:
|
|||
__log__.error('Read invalid packet length %d, '
|
||||
'reading data left:', packet_len)
|
||||
while True:
|
||||
data = b''
|
||||
try:
|
||||
__log__.error(repr(self.read(1)))
|
||||
data += self.read(1)
|
||||
except TimeoutError:
|
||||
break
|
||||
finally:
|
||||
__log__.error(repr(data))
|
||||
# Connection reset and hope it's fixed after
|
||||
self.conn.close()
|
||||
raise ConnectionResetError()
|
||||
|
|
Loading…
Reference in New Issue
Block a user