mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-23 01:46:35 +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, '
|
__log__.error('Read invalid packet length %d, '
|
||||||
'reading data left:', packet_len)
|
'reading data left:', packet_len)
|
||||||
while True:
|
while True:
|
||||||
|
data = b''
|
||||||
try:
|
try:
|
||||||
__log__.error(repr(self.read(1)))
|
data += self.read(1)
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
break
|
break
|
||||||
|
finally:
|
||||||
|
__log__.error(repr(data))
|
||||||
# Connection reset and hope it's fixed after
|
# Connection reset and hope it's fixed after
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
raise ConnectionResetError()
|
raise ConnectionResetError()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user