Fix still broken log for broken packets

This commit is contained in:
Lonami Exo 2018-05-07 16:46:58 +02:00
parent cd410d7fd7
commit 01a594ca5d

View File

@ -192,14 +192,15 @@ class Connection:
if packet_len <= 12: if packet_len <= 12:
__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: data = b''
data = b'' try:
try: while True:
data += await self.read(1) data += await self.read(1)
except TimeoutError: except TimeoutError:
break pass
finally: finally:
__log__.error(repr(data)) __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()