Update autorecon.py
Fixes #68 Instead of messing around with limits, we should ignore any line longer than 64 KiB, as it is likely invalid data of some kind anyway.
This commit is contained in:
parent
62a87f9696
commit
24f71534dd
|
@ -161,7 +161,12 @@ class CommandStreamReader(object):
|
|||
while True:
|
||||
if self.stream.at_eof():
|
||||
break
|
||||
try:
|
||||
line = (await self.stream.readline()).decode('utf8').rstrip()
|
||||
except ValueError:
|
||||
error('{blue}[{bright}' + self.target.address + '/' + self.tag + '{srst}]{crst} A line was longer than 64 KiB and cannot be processed. Ignoring.')
|
||||
continue
|
||||
|
||||
if self.target.autorecon.config['verbose'] >= 2:
|
||||
if line != '':
|
||||
info('{blue}[{bright}' + self.target.address + '/' + self.tag + '{srst}]{crst} ' + line.replace('{', '{{').replace('}', '}}'))
|
||||
|
|
Loading…
Reference in New Issue