fixed nasty bug where tor circuits was causing gevent to leak threads
This commit is contained in:
parent
022fbaa1af
commit
e6181bdd1f
12 changed files with 47 additions and 39 deletions
|
@ -49,21 +49,21 @@ class DirectConnectionManagement:
|
|||
if pubkey in communicator.direct_connection_clients:
|
||||
resp = communicator.direct_connection_clients[pubkey]
|
||||
return Response(resp)
|
||||
|
||||
|
||||
@direct_conn_management_bp.route('/dc-client/connect/<pubkey>')
|
||||
def make_new_connection(pubkey):
|
||||
communicator = _get_communicator(g)
|
||||
resp = "pending"
|
||||
if pubkey in communicator.shared_state.get(pool.ServicePool).bootstrap_pending:
|
||||
return Response(resp)
|
||||
|
||||
|
||||
if pubkey in communicator.direct_connection_clients:
|
||||
resp = communicator.direct_connection_clients[pubkey]
|
||||
else:
|
||||
"""Spawn a thread that will create the client and eventually add it to the
|
||||
communicator.active_services
|
||||
communicator.active_services
|
||||
"""
|
||||
threading.Thread(target=onionrservices.OnionrServices().create_client,
|
||||
threading.Thread(target=onionrservices.OnionrServices().create_client,
|
||||
args=[pubkey, communicator], daemon=True).start()
|
||||
|
||||
return Response(resp)
|
Loading…
Add table
Add a link
Reference in a new issue