refine deps

This commit is contained in:
Jun Kurihara 2022-07-22 23:32:14 +09:00
commit 66e791f34b
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
11 changed files with 85 additions and 65 deletions

View file

@ -157,25 +157,29 @@ pub fn parse_opts(globals: &mut Globals) -> Result<()> {
// experimental
if let Some(exp) = config.experimental {
if let Some(h3option) = exp.h3 {
globals.http3 = true;
info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.");
if let Some(x) = h3option.alt_svc_max_age {
globals.h3_alt_svc_max_age = x;
}
if let Some(x) = h3option.request_max_body_size {
globals.h3_request_max_body_size = x;
}
if let Some(x) = h3option.max_concurrent_connections {
globals.h3_max_concurrent_connections = x;
}
if let Some(x) = h3option.max_concurrent_bidistream {
globals.h3_max_concurrent_bidistream = x.into();
}
if let Some(x) = h3option.max_concurrent_unistream {
globals.h3_max_concurrent_unistream = x.into();
#[cfg(feature = "http3")]
{
if let Some(h3option) = exp.h3 {
globals.http3 = true;
info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.");
if let Some(x) = h3option.alt_svc_max_age {
globals.h3_alt_svc_max_age = x;
}
if let Some(x) = h3option.request_max_body_size {
globals.h3_request_max_body_size = x;
}
if let Some(x) = h3option.max_concurrent_connections {
globals.h3_max_concurrent_connections = x;
}
if let Some(x) = h3option.max_concurrent_bidistream {
globals.h3_max_concurrent_bidistream = x.into();
}
if let Some(x) = h3option.max_concurrent_unistream {
globals.h3_max_concurrent_unistream = x.into();
}
}
}
if let Some(b) = exp.ignore_sni_consistency {
globals.sni_consistency = !b;
if b {

View file

@ -15,6 +15,7 @@ pub struct ConfigToml {
pub experimental: Option<Experimental>,
}
#[cfg(feature = "http3")]
#[derive(Deserialize, Debug, Default)]
pub struct Http3Option {
pub alt_svc_max_age: Option<u32>,
@ -26,6 +27,7 @@ pub struct Http3Option {
#[derive(Deserialize, Debug, Default)]
pub struct Experimental {
#[cfg(feature = "http3")]
pub h3: Option<Http3Option>,
pub ignore_sni_consistency: Option<bool>,
}