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 });