From 236205c0f37ae47a5954b767826ac92b20d7bdf8 Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Tue, 19 Sep 2023 18:25:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=85=E7=BD=91ip=E6=96=AD?= =?UTF-8?q?=E7=BA=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/Cargo.toml | 2 +- vnt-cli/Cargo.toml | 2 +- vnt-jni/Cargo.toml | 2 +- vnt/Cargo.toml | 2 +- vnt/src/channel/channel.rs | 2 ++ vnt/src/ip_proxy/tcp_proxy.rs | 8 ++++++-- vnt/src/lib.rs | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/Cargo.toml b/common/Cargo.toml index 60b6eeb..0cba155 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common" -version = "1.2.3" +version = "1.2.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/vnt-cli/Cargo.toml b/vnt-cli/Cargo.toml index ce73575..1f8af26 100644 --- a/vnt-cli/Cargo.toml +++ b/vnt-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vnt-cli" -version = "1.2.3" +version = "1.2.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/vnt-jni/Cargo.toml b/vnt-jni/Cargo.toml index 7b4984d..a689460 100644 --- a/vnt-jni/Cargo.toml +++ b/vnt-jni/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vnt-jni" -version = "1.2.3" +version = "1.2.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/vnt/Cargo.toml b/vnt/Cargo.toml index a17fa6d..7cc821b 100644 --- a/vnt/Cargo.toml +++ b/vnt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vnt" -version = "1.2.3" +version = "1.2.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/vnt/src/channel/channel.rs b/vnt/src/channel/channel.rs index 970f6f7..8c6bbfb 100644 --- a/vnt/src/channel/channel.rs +++ b/vnt/src/channel/channel.rs @@ -526,6 +526,8 @@ impl Context { pub fn update_read_time(&self, id: &Ipv4Addr, route_key: &RouteKey) { if let Some(mut time) = self.inner.route_table_time.get_mut(&(*route_key, *id)) { *time.value_mut() = Instant::now(); + }else{ + self.inner.route_table_time.insert((*route_key,*id),Instant::now()); } } } diff --git a/vnt/src/ip_proxy/tcp_proxy.rs b/vnt/src/ip_proxy/tcp_proxy.rs index bad11f7..54be780 100644 --- a/vnt/src/ip_proxy/tcp_proxy.rs +++ b/vnt/src/ip_proxy/tcp_proxy.rs @@ -86,8 +86,12 @@ async fn proxy(mut client: TcpStream, mut server: TcpStream) -> io::Result<()> { let client_to_server = tokio::io::copy(&mut client_reader, &mut server_writer); let server_to_client = tokio::io::copy(&mut server_reader, &mut client_writer); tokio::select! { - _ = tokio::time::timeout(Duration::from_secs(10), client_to_server) =>{}, - _ = tokio::time::timeout(Duration::from_secs(10), server_to_client) =>{}, + rs = server_to_client =>{ + log::info!("server_to_client proxy={:?}",rs); + }, + rs = client_to_server =>{ + log::info!("client_to_server proxy={:?}",rs); + }, } Ok(()) } diff --git a/vnt/src/lib.rs b/vnt/src/lib.rs index aadf8c1..5ef0891 100644 --- a/vnt/src/lib.rs +++ b/vnt/src/lib.rs @@ -1,5 +1,5 @@ use crate::error::Error; -pub const VNT_VERSION: &'static str = "1.2.3"; +pub const VNT_VERSION: &'static str = "1.2.4"; pub type Result = std::result::Result; pub mod channel;