Commit 7e156524 authored by anonym's avatar anonym
Browse files

tor-controlport-filter: improve variable names.

parent c09b9293
......@@ -324,17 +324,17 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
# in place, to combine multiple matched filters
# without loss.
if 'commands' in filter_:
for key in filter_['commands']:
new = filter_['commands'][key]
key = key.upper()
old = allowed_commands.get(key, [])
for cmd in filter_['commands']:
new_rules = filter_['commands'][cmd]
cmd = cmd.upper()
old_rules = allowed_commands.get(cmd, [])
# Allow "simple" matching rules where the
# 'pattern' key is implicit.
for i in range(len(new)):
rule = new[i]
for i in range(len(new_rules)):
rule = new_rules[i]
if isinstance(rule, str):
new[i] = {'pattern': rule}
allowed_commands[key] = old + new
new_rules[i] = {'pattern': rule}
allowed_commands[cmd] = old_rules + new_rules
if 'events' in filter_:
for key in filter_['events']:
val = filter_['events'][key]
......
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