mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
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:
parent
fe0a025d09
commit
d6d9374b66
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user