Commit 5e7601e5 authored by anonym's avatar anonym

tor-controlport-filter: log disconnects.

parent 8fef3f7a
......@@ -240,14 +240,19 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
.format(client_exe_path, client_conn.pid, client_user, status)
)
controller = self.connect_to_real_control_port()
disconnect_reason = "client quit"
try:
handle_controlport_session(controller, self.rfile, self.wfile,
allowed_commands, allowed_events)
except (ConnectionResetError, BrokenPipeError):
except (ConnectionResetError, BrokenPipeError) as err:
# Handle clients disconnecting abruptly
pass
disconnect_reason = str(err)
finally:
controller.close()
print('{} (PID: {}, user: {}) disconnected: {}'
.format(client_exe_path, client_conn.pid, client_user,
disconnect_reason)
)
def main():
......
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