From ec202209f31a77dd36dd2ba44d5c062a066ec6f5 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 18 Feb 2023 13:41:45 +0800 Subject: [PATCH] fix ID_EXISTS not sent out due to ipv6 change --- src/rendezvous_server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index 924c1a2..39dc13c 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -789,7 +789,7 @@ impl RendezvousServer { #[inline] async fn send_to_tcp(&mut self, msg: RendezvousMessage, addr: SocketAddr) { - let mut tcp = self.tcp_punch.lock().await.remove(&addr); + let mut tcp = self.tcp_punch.lock().await.remove(&try_into_v4(addr)); tokio::spawn(async move { Self::send_to_sink(&mut tcp, msg).await; }); @@ -817,7 +817,7 @@ impl RendezvousServer { msg: RendezvousMessage, addr: SocketAddr, ) -> ResultType<()> { - let mut sink = self.tcp_punch.lock().await.remove(&addr); + let mut sink = self.tcp_punch.lock().await.remove(&try_into_v4(addr)); Self::send_to_sink(&mut sink, msg).await; Ok(()) } @@ -1126,7 +1126,7 @@ impl RendezvousServer { } } if sink.is_none() { - self.tcp_punch.lock().await.remove(&addr); + self.tcp_punch.lock().await.remove(&try_into_v4(addr)); } log::debug!("Tcp connection from {:?} closed", addr); Ok(())