Commit 42bb0367 authored by anonym's avatar anonym
Browse files

tor-controlport-filter: ignore whitespace-only lines.

parent 978f2e2d
...@@ -219,7 +219,7 @@ def handle_controlport_session(controller, readh, writeh, allowed_commands, allo ...@@ -219,7 +219,7 @@ def handle_controlport_session(controller, readh, writeh, allowed_commands, allo
client_streams = set() client_streams = set()
while True: while True:
line = str(readh.readline(MAX_LINESIZE), 'ascii').strip() line = str(readh.readline(MAX_LINESIZE), 'ascii').strip()
if not line: break if not line or line.isspace(): break
debug_log_recv(line) debug_log_recv(line)
# This regex makes us split on unquoted whitespaces. # This regex makes us split on unquoted whitespaces.
cmd, *args = re.findall(r'(?:[^\s,"]|"(?:\\.|[^"])*")+', line) cmd, *args = re.findall(r'(?:[^\s,"]|"(?:\\.|[^"])*")+', line)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment