experimental h3 toml config support

This commit is contained in:
Jun Kurihara 2022-07-05 19:30:28 +09:00
commit 7283137343
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
6 changed files with 29 additions and 0 deletions

View file

@ -151,6 +151,16 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut Backends) -> Result<()>
}
}
// experimental
if let Some(exp) = config.experimental {
if let Some(b) = exp.h3 {
globals.http3 = b;
if b {
info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.")
}
}
}
Ok(())
}

View file

@ -13,6 +13,12 @@ pub struct ConfigToml {
pub max_clients: Option<u32>,
pub apps: Option<Apps>,
pub default_app: Option<String>,
pub experimental: Option<Experimental>,
}
#[derive(Deserialize, Debug, Default)]
pub struct Experimental {
pub h3: Option<bool>,
}
#[derive(Deserialize, Debug, Default)]

View file

@ -16,6 +16,7 @@ pub struct Globals {
pub clients_count: ClientsCount,
pub max_concurrent_streams: u32,
pub keepalive: bool,
pub http3: bool,
pub runtime_handle: tokio::runtime::Handle,
}

View file

@ -55,6 +55,7 @@ fn main() {
listen_sockets: Vec::new(),
http_port: None,
https_port: None,
http3: false,
timeout: Duration::from_secs(TIMEOUT_SEC),
max_clients: MAX_CLIENTS,
clients_count: Default::default(),