From 1e6376c497a6eb571ed65470c2f66e214da37ad8 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Thu, 25 Apr 2024 15:41:28 +0300 Subject: [PATCH] tor: fix restart --- src/tor/tor.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tor/tor.rs b/src/tor/tor.rs index 300f8bd..928736b 100644 --- a/src/tor/tor.rs +++ b/src/tor/tor.rs @@ -104,10 +104,9 @@ impl TorServer { // Check if Tor client is already running. if TOR_SERVER_STATE.client.read().unwrap().is_some() { let r_client = TOR_SERVER_STATE.client.read().unwrap(); - let runtime = TokioNativeTlsRuntime::create().unwrap(); - let _ = runtime.clone().block_on( - Self::launch_socks_proxy(runtime, r_client.as_ref().unwrap().clone()) - ); + let client = r_client.as_ref().unwrap().clone(); + let runtime = client.runtime().clone(); + let _ = runtime.clone().block_on(Self::launch_socks_proxy(runtime, client)); } else { // Create Tor client config to connect. let mut builder = TorClientConfig::builder();