Serve plain HTTP through the shared hyper accept loop with connection cap and header timeout
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
1 parent
d5a0373a75
commit
f1d659965b
6 files changed
+245
-136
No files matched your search
+5
-5
@@ -567,7 +567,7 @@ async fn sigterm_with_open_tls_connections_exits_promptly() {
|
||||
/// In-process TLS listener with explicit limits.
|
||||
async fn inproc(
|
||||
pair: &Pair,
|
||||
limits: skyg_linux_tracker::tls::Limits,
|
||||
limits: skyg_linux_tracker::server::Limits,
|
||||
) -> (u16, tokio_util::sync::CancellationToken, tempdir::Dir) {
|
||||
use skyg_linux_tracker::{config::Config, server, sources::fake::fake_state, tls};
|
||||
let dir = tempdir::Dir::new("inproc");
|
||||
@@ -584,9 +584,9 @@ async fn inproc(
|
||||
let app = server::build_router(state);
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
tokio::spawn(tls::serve_tls(
|
||||
tokio::spawn(server::serve_listener(
|
||||
listener,
|
||||
acceptor,
|
||||
Some(acceptor),
|
||||
app,
|
||||
shutdown.clone(),
|
||||
limits,
|
||||
@@ -609,7 +609,7 @@ async fn silent_connection_closed_after_header_timeout() {
|
||||
let pair = gen_pair();
|
||||
let (port, shutdown, _d) = inproc(
|
||||
&pair,
|
||||
skyg_linux_tracker::tls::Limits {
|
||||
skyg_linux_tracker::server::Limits {
|
||||
max_conns: 16,
|
||||
header_timeout: Duration::from_millis(500),
|
||||
},
|
||||
@@ -637,7 +637,7 @@ async fn connection_cap_is_enforced() {
|
||||
let pair = gen_pair();
|
||||
let (port, shutdown, _d) = inproc(
|
||||
&pair,
|
||||
skyg_linux_tracker::tls::Limits {
|
||||
skyg_linux_tracker::server::Limits {
|
||||
max_conns: 2,
|
||||
header_timeout: Duration::from_secs(30),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user