refactor
This commit is contained in:
parent
fab28e8609
commit
1f98b69c7e
4 changed files with 12 additions and 18 deletions
|
|
@ -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",
|
||||
|
|
|
|||
2
quinn
2
quinn
|
|
@ -1 +1 @@
|
|||
Subproject commit b30711f5595983989b60bbbad0ac3f067be7a596
|
||||
Subproject commit e652b6d999f053ffe21eeea247854882ae480281
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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::<HandshakeData>() {
|
||||
Ok(d) => d,
|
||||
Err(_) => continue
|
||||
let Ok(hsd_downcast) = hsd.downcast::<HandshakeData>() 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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue