From db6f3ea3ce6c051573230d0bc741fa3a7d02b373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Tue, 9 Jan 2024 21:04:46 +0100 Subject: [PATCH] Add typealias socks5 udp --- src/socks5_udp.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/socks5_udp.rs b/src/socks5_udp.rs index c79caaf..39e1edd 100644 --- a/src/socks5_udp.rs +++ b/src/socks5_udp.rs @@ -24,13 +24,15 @@ use tokio::time::Interval; use tracing::{debug, error, info}; use url::Host; +type PeerMapKey = (SocketAddr, TargetAddr); + struct IoInner { sender: mpsc::Sender, } struct Socks5UdpServer { listener: Arc, - peers: HashMap<(SocketAddr, TargetAddr), Pin>, ahash::RandomState>, - keys_to_delete: Arc>>, + peers: HashMap>, ahash::RandomState>, + keys_to_delete: Arc>>, cnx_timeout: Option, } @@ -82,7 +84,7 @@ pub struct Socks5UdpStream { pub watchdog_deadline: Option, data_read_before_deadline: bool, io: Pin>, - keys_to_delete: Weak>>, + keys_to_delete: Weak>>, } #[pinned_drop] @@ -100,7 +102,7 @@ impl Socks5UdpStream { peer: SocketAddr, destination: TargetAddr, watchdog_deadline: Option, - keys_to_delete: Weak>>, + keys_to_delete: Weak>>, ) -> (Self, Pin>) { let (tx, rx) = mpsc::channel(1024); let io = Arc::pin(IoInner { sender: tx });