修复内网ip断线问题
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "vnt-cli"
|
name = "vnt-cli"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "vnt-jni"
|
name = "vnt-jni"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "vnt"
|
name = "vnt"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# 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) {
|
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)) {
|
if let Some(mut time) = self.inner.route_table_time.get_mut(&(*route_key, *id)) {
|
||||||
*time.value_mut() = Instant::now();
|
*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 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);
|
let server_to_client = tokio::io::copy(&mut server_reader, &mut client_writer);
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = tokio::time::timeout(Duration::from_secs(10), client_to_server) =>{},
|
rs = server_to_client =>{
|
||||||
_ = tokio::time::timeout(Duration::from_secs(10), server_to_client) =>{},
|
log::info!("server_to_client proxy={:?}",rs);
|
||||||
|
},
|
||||||
|
rs = client_to_server =>{
|
||||||
|
log::info!("client_to_server proxy={:?}",rs);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
use crate::error::Error;
|
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 type Result<T> = std::result::Result<T, Error>;
|
||||||
|
|
||||||
pub mod channel;
|
pub mod channel;
|
||||||
|
|||||||
Reference in New Issue
Block a user