修复内网ip断线问题
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
+1
-1
@@ -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<T> = std::result::Result<T, Error>;
|
||||
|
||||
pub mod channel;
|
||||
|
||||
Reference in New Issue
Block a user