From 30d06937fc9aafb614fe32eba29853d0bc5676da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 3 Apr 2022 00:43:38 +0200 Subject: [PATCH] http_private: disable keep_alive --- aquatic_http_private/src/config.rs | 3 --- aquatic_http_private/src/workers/socket/mod.rs | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/aquatic_http_private/src/config.rs b/aquatic_http_private/src/config.rs index 713ea8c..d595376 100644 --- a/aquatic_http_private/src/config.rs +++ b/aquatic_http_private/src/config.rs @@ -55,8 +55,6 @@ pub struct NetworkConfig { pub tls_certificate_path: PathBuf, /// Path to TLS private key (DER-encoded ASN.1 in PKCS#8 or PKCS#1 format) pub tls_private_key_path: PathBuf, - /// Keep connections alive after sending a response - pub keep_alive: bool, } impl Default for NetworkConfig { @@ -65,7 +63,6 @@ impl Default for NetworkConfig { address: SocketAddr::from(([0, 0, 0, 0], 3000)), tls_certificate_path: "".into(), tls_private_key_path: "".into(), - keep_alive: false, } } } diff --git a/aquatic_http_private/src/workers/socket/mod.rs b/aquatic_http_private/src/workers/socket/mod.rs index 10fcf6c..0f009f5 100644 --- a/aquatic_http_private/src/workers/socket/mod.rs +++ b/aquatic_http_private/src/workers/socket/mod.rs @@ -46,6 +46,7 @@ async fn run_app( .layer(Extension(Arc::new(request_sender))); axum::Server::from_tcp(tcp_listener)? + .http1_keepalive(false) .serve(app.into_make_service_with_connect_info::()) .await?;