diff --git a/Cargo.toml b/Cargo.toml index c73533e..5defb89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ clap = { version = "4.3.11", features = ["std", "cargo", "wrap_help"] } rand = "0.8.5" toml = { version = "0.7.6", default-features = false, features = ["parse"] } rustc-hash = "1.1.0" -serde = { version = "1.0.167", default-features = false, features = ["derive"] } +serde = { version = "1.0.171", default-features = false, features = ["derive"] } bytes = "1.4.0" thiserror = "1.0.43" x509-parser = "0.15.0" @@ -31,7 +31,6 @@ futures = { version = "0.3.28", features = ["alloc", "async-await"] } tokio = { version = "1.29.1", default-features = false, features = [ "net", "rt-multi-thread", - "parking_lot", "time", "sync", "macros", diff --git a/quinn b/quinn index b30711f..e652b6d 160000 --- a/quinn +++ b/quinn @@ -1 +1 @@ -Subproject commit b30711f5595983989b60bbbad0ac3f067be7a596 +Subproject commit e652b6d999f053ffe21eeea247854882ae480281 diff --git a/src/globals.rs b/src/globals.rs index cd47611..64f9d8d 100644 --- a/src/globals.rs +++ b/src/globals.rs @@ -12,7 +12,7 @@ pub struct Globals { /// Configuration parameters for proxy transport and request handlers pub proxy_config: ProxyConfig, // TODO: proxy configはarcに包んでこいつだけ使いまわせばいいように変えていく。backendsも? - /// Shared context - Backend application objects to which http request handler forward incoming requests + /// Backend application objects to which http request handler forward incoming requests pub backends: Backends, /// Shared context - Counter for serving requests diff --git a/src/proxy/proxy_tls.rs b/src/proxy/proxy_tls.rs index aa9c69f..317be7c 100644 --- a/src/proxy/proxy_tls.rs +++ b/src/proxy/proxy_tls.rs @@ -146,29 +146,24 @@ where continue; } let mut conn: quinn::Connecting = new_conn.unwrap(); - let hsd = match conn.handshake_data().await { - Ok(h) => h, - Err(_) => continue + let Ok(hsd) = conn.handshake_data().await else { + continue }; - let hsd_downcast = match hsd.downcast::() { - Ok(d) => d, - Err(_) => continue + let Ok(hsd_downcast) = hsd.downcast::() else { + continue }; - let new_server_name = match hsd_downcast.server_name { - Some(sn) => sn.to_server_name_vec(), - None => { - warn!("HTTP/3 no SNI is given"); - continue; - } + let Some(new_server_name) = hsd_downcast.server_name else { + warn!("HTTP/3 no SNI is given"); + continue; }; debug!( "HTTP/3 connection incoming (SNI {:?})", - new_server_name.0 + new_server_name ); // TODO: server_nameをここで出してどんどん深く投げていくのは効率が悪い。connecting -> connectionsの後でいいのでは? // TODO: 通常のTLSと同じenumか何かにまとめたい - let fut = self.clone().connection_serve_h3(conn, new_server_name); + let fut = self.clone().connection_serve_h3(conn, new_server_name.to_server_name_vec()); self.globals.runtime_handle.spawn(async move { // Timeout is based on underlying quic if let Err(e) = fut.await {