Fix still broken log for broken packets

This commit is contained in:
Lonami Exo 2018-05-07 16:46:58 +02:00
parent 6cd96389c0
commit 2922e8df11

View File

@ -190,14 +190,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 += self.read(1) data += 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()