Commit cad3d9aa authored by anonym's avatar anonym

tor-controlport-filter: handle Tor closing its socket.

For instance, if tor is restarted while we are connected.
parent a16502a5
......@@ -512,6 +512,9 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
except (ConnectionResetError, BrokenPipeError) as err:
# Handle clients disconnecting abruptly
disconnect_reason = str(err)
except stem.SocketClosed:
# Handle Tor closing it's socket abruptly
disconnect_reason = "Tor closed its socket"
finally:
controller.close()
log('{} disconnected: {}'.format(client_desc, disconnect_reason))
......
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