mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
optimize the condition of enabling kcp (#1210)
This commit is contained in:
@@ -751,8 +751,16 @@ impl Socks5Server {
|
||||
continue;
|
||||
};
|
||||
|
||||
let Some(peer_mgr_arc) = peer_mgr.upgrade() else {
|
||||
tracing::error!("peer manager is dropped");
|
||||
continue;
|
||||
};
|
||||
|
||||
let dst_allow_kcp = peer_mgr_arc.check_allow_kcp_to_dst(&dst_addr.ip()).await;
|
||||
tracing::debug!("dst_allow_kcp: {:?}", dst_allow_kcp);
|
||||
|
||||
let connector: Box<dyn AsyncTcpConnector<S = SocksTcpStream> + Send> =
|
||||
if kcp_endpoint.is_none() {
|
||||
if kcp_endpoint.is_none() || !dst_allow_kcp {
|
||||
Box::new(SmolTcpConnector {
|
||||
net: net.smoltcp_net.clone(),
|
||||
entries: entries.clone(),
|
||||
|
||||
Reference in New Issue
Block a user