Skip to content

Commit

Permalink
clippy and change hop interval
Browse files Browse the repository at this point in the history
  • Loading branch information
eauxxs committed Oct 21, 2024
1 parent ec4ecf2 commit 176e5fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clash_lib/src/app/profile/mod.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions clash_lib/src/proxy/hysteria2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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<Self> {
let verify = CertVerifyOption::new(
Expand Down Expand Up @@ -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?;
Expand Down

0 comments on commit 176e5fa

Please sign in to comment.