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(())