diff --git a/clash_lib/src/app/profile/mod.rs b/clash_lib/src/app/profile/mod.rs index 9d8a39a0..c458069b 100644 --- a/clash_lib/src/app/profile/mod.rs +++ b/clash_lib/src/app/profile/mod.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, sync::Arc}; use serde::{Deserialize, Serialize}; -use tracing::{error, warn}; +use tracing::{error, trace, warn}; #[derive(Serialize, Deserialize, Debug, Clone)] struct Db { diff --git a/clash_lib/src/proxy/hysteria2/mod.rs b/clash_lib/src/proxy/hysteria2/mod.rs index 2674dcbf..0f8b1989 100644 --- a/clash_lib/src/proxy/hysteria2/mod.rs +++ b/clash_lib/src/proxy/hysteria2/mod.rs @@ -184,7 +184,7 @@ impl ServerCertVerifier for CertVerifyOption { if let Some(ref cert) = self.certificate { if cert != end_entity { - return Err(rustls::Error::General(format!("cert mismatch",))); + return Err(rustls::Error::General("cert mismatch".to_string())); } else { return Ok(ServerCertVerified::assertion()); } @@ -269,7 +269,7 @@ impl Debug for Handler { impl Handler { const DEFAULT_MAX_IDLE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(300); - const HOP_INTERVAL: std::time::Duration = std::time::Duration::from_secs(2); + const HOP_INTERVAL: std::time::Duration = std::time::Duration::from_secs(30); pub fn new(opts: HystOption) -> anyhow::Result { let verify = CertVerifyOption::new( @@ -380,6 +380,7 @@ impl Handler { ticker.tick().await; loop { select! { + // TODO if the connection has no stream, should not rebind _ = ticker.tick() => { let ep = ep.get().unwrap(); let udp = opts.get_udp_socket(&sess, ep.local_addr().unwrap().is_ipv6()).await?;