wip: fix keep alive timeouts

This commit is contained in:
Jun Kurihara 2023-12-11 18:40:31 +09:00
commit b8f3034014
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
3 changed files with 9 additions and 1 deletions

View file

@ -1,10 +1,12 @@
mod body_incoming_like;
mod body_type;
mod executor;
mod tokio_timer;
mod watch;
pub(crate) mod rt {
pub(crate) use super::executor::LocalExecutor;
pub(crate) use super::tokio_timer::{TokioSleep, TokioTimer};
}
pub(crate) mod body {
pub(crate) use super::body_incoming_like::IncomingLike;

View file

@ -6,7 +6,10 @@ mod proxy_quic_quinn;
mod proxy_quic_s2n;
mod socket;
use crate::{globals::Globals, hyper_ext::rt::LocalExecutor};
use crate::{
globals::Globals,
hyper_ext::rt::{LocalExecutor, TokioTimer},
};
use hyper_util::server::{self, conn::auto::Builder as ConnectionBuilder};
use std::sync::Arc;
@ -20,10 +23,12 @@ pub(crate) fn connection_builder(globals: &Arc<Globals>) -> Arc<ConnectionBuilde
.http1()
.keep_alive(globals.proxy_config.keepalive)
.header_read_timeout(globals.proxy_config.proxy_idle_timeout)
.timer(TokioTimer)
.pipeline_flush(true);
http_server
.http2()
.keep_alive_interval(Some(globals.proxy_config.proxy_idle_timeout))
.timer(TokioTimer)
.max_concurrent_streams(globals.proxy_config.max_concurrent_streams);
Arc::new(http_server)
}