From a334768aa35d4799f01f05812777f5bd20193d88 Mon Sep 17 00:00:00 2001 From: arloor Date: Thu, 5 Sep 2024 00:18:35 +0800 Subject: [PATCH] chore: Refactor code in local/utils.rs for better readability and maintainability --- crates/shadowsocks-service/src/local/utils.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/shadowsocks-service/src/local/utils.rs b/crates/shadowsocks-service/src/local/utils.rs index 6600f03e9268..12d7b7d9a99b 100644 --- a/crates/shadowsocks-service/src/local/utils.rs +++ b/crates/shadowsocks-service/src/local/utils.rs @@ -3,10 +3,7 @@ use std::{io, net::SocketAddr, time::Duration}; use log::{debug, trace}; -use shadowsocks::{ - config::ServerConfig, - relay::{socks5::Address, tcprelay}, -}; +use shadowsocks::{config::ServerConfig, relay::socks5::Address}; use tokio::{ io::{copy_bidirectional, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}, time, @@ -69,7 +66,8 @@ where #[cfg(feature = "https-tunnel")] let result = copy_bidirectional(shadow, plain).await; #[cfg(not(feature = "https-tunnel"))] - let result = tcprelay::utils::copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await; + let result = + shadowsocks::relay::tcprelay::utils::copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await; match result { Ok((wn, rn)) => { trace!(