@@ -2,12 +2,12 @@ use std::net::{TcpStream, ToSocketAddrs};
22use std:: path:: PathBuf ;
33#[ cfg( target_family = "unix" ) ]
44use std:: process:: Command ;
5- use std:: sync:: Arc ;
5+ use std:: sync:: { Arc , Mutex } ;
66use std:: sync:: atomic:: { AtomicBool , Ordering } ;
77use std:: thread;
88use std:: time:: { Duration , Instant , SystemTime , UNIX_EPOCH } ;
99
10- use anyhow:: { Result , bail} ;
10+ use anyhow:: { Context , Result , bail} ;
1111use tokio:: sync:: watch;
1212
1313use crate :: certs:: { ensure_bundle, load_bundle} ;
@@ -26,6 +26,8 @@ use crate::platform::{
2626use crate :: proxy:: run_proxy;
2727use crate :: runtime_log;
2828use crate :: state;
29+ #[ cfg( unix) ]
30+ use crate :: helper_ipc:: HelperResponse ;
2931
3032pub fn resolve_paths ( config_override : Option < PathBuf > ) -> Result < AppPaths > {
3133 let paths = AppPaths :: resolve ( config_override) ?;
@@ -267,9 +269,7 @@ pub fn helper_stop(config_path: Option<PathBuf>) -> Result<()> {
267269/// spawned, which avoids zombie-process issues entirely.
268270#[ cfg( unix) ]
269271pub fn run_privileged_helper ( config_path : Option < PathBuf > ) -> Result < ( ) > {
270- use std:: sync:: Mutex ;
271-
272- use crate :: helper_ipc:: { self , HelperRequest , HelperResponse } ;
272+ use crate :: helper_ipc:: { self , HelperRequest } ;
273273
274274 let paths = resolve_paths ( config_path. clone ( ) ) ?;
275275 log_info (
@@ -306,8 +306,6 @@ fn handle_helper_start(
306306 config_path : & std:: path:: Path ,
307307 proxy_state : & Arc < Mutex < Option < ProxyHandle > > > ,
308308) -> HelperResponse {
309- use crate :: helper_ipc:: HelperResponse ;
310-
311309 let config_path = config_path. to_path_buf ( ) ;
312310
313311 // If proxy is already running, stop it first.
@@ -392,7 +390,6 @@ fn handle_helper_stop(
392390 config_path : & std:: path:: Path ,
393391 proxy_state : & Arc < Mutex < Option < ProxyHandle > > > ,
394392) -> HelperResponse {
395- use crate :: helper_ipc:: HelperResponse ;
396393
397394 let config_path = config_path. to_path_buf ( ) ;
398395
@@ -447,7 +444,6 @@ fn handle_helper_status(
447444 config_path : & std:: path:: Path ,
448445 proxy_state : & Arc < Mutex < Option < ProxyHandle > > > ,
449446) -> HelperResponse {
450- use crate :: helper_ipc:: HelperResponse ;
451447
452448 match status ( Some ( config_path. to_path_buf ( ) ) ) {
453449 Ok ( s) => HelperResponse {
0 commit comments