configctl, ignore end of stream marker, the normal exit when no data for python should be enough, closes https://github.com/opnsense/core/issues/2568

Initially we had issues with datablocks containing \0, for which we added an end of stream marker. in python this doesn't seem necessary, so better to remove to prevent cpu overload when the connection is lost.
This commit is contained in:
Ad Schellevis 2018-07-26 21:52:47 +02:00
parent fe0a025d09
commit d6d9374b66

View File

@ -65,11 +65,7 @@ def exec_config_cmd(exec_command):
line = sock.recv(65536)
if line:
data.append(line)
# end of stream marker found, exit
if line.find("%c%c%c"%(chr(0), chr(0), chr(0))) > -1 or (
len(line) < 3 and len(data) > 1 and (''.join(data[-2:])).find("%c%c%c"%(chr(0), chr(0), chr(0))) > -1
):
else:
break
return ''.join(data)[:-3]