Commit 4d1249dc authored by anonym's avatar anonym
Browse files

tor-controlport-filter: do SETEVENTS properly with --complain.

The old idea was to delegate it to the catch-all case, but it won't work
since we need to use stem's event listening system.
parent 69421087
......@@ -108,7 +108,7 @@ def handle_controlport_session(controller, readh, writeh, allowed_commands, allo
# The client will be fooled that it is subscribing to all
# events it requested, but we will only let through allowed
# events.
elif cmd == "SETEVENTS" and not global_args.complain:
elif cmd == "SETEVENTS":
for listener in subscribed_event_listeners:
controller.remove_event_listener(listener)
subscribed_event_listeners = []
......@@ -116,7 +116,7 @@ def handle_controlport_session(controller, readh, writeh, allowed_commands, allo
# The control language doesn't care about case for
# the event type.
event = event.upper()
if event in allowed_events:
if event in allowed_events or global_args.complain:
def event_cb(event):
respond(event.raw_content(), raw=True)
controller.add_event_listener(
......
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