From 5522e36125ec0a7a0aa0faa4341db2151249bbff Mon Sep 17 00:00:00 2001 From: reverse Date: Mon, 17 Aug 2026 21:37:18 +0000 Subject: [PATCH] reactor: reap proxy-pending connections that never send their PROXY header (were never timed out) --- src/socketengine.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/socketengine.rs b/src/socketengine.rs index 2f5e9ab..155590b 100644 --- a/src/socketengine.rs +++ b/src/socketengine.rs @@ -502,7 +502,7 @@ fn reactor_loop( let now = Instant::now(); let mut expired = Vec::new(); pending_hs.retain(|&(tok, dl)| match conns.get(&tok) { - Some(c) if c.handshaking => { + Some(c) if c.handshaking || c.proxy_pending => { if now >= dl { expired.push(tok); false @@ -510,7 +510,7 @@ fn reactor_loop( true } } - _ => false, // handshake finished, or the conn is already gone + _ => false, // handshake/proxy-header done, or the conn is already gone }); for tok in expired { close_conn(&mut poll, &mut conns, tok, &core); @@ -572,7 +572,10 @@ fn reactor_loop( pending_out: Some(out), }, ); - if handshaking { + // reap a stalled TLS handshake OR a proxy-pending conn that never + // sends its PROXY header — neither has a uid yet, so nothing else + // would ever time it out. + if handshaking || a.via_proxy { if let Some(d) = handshake_timeout { pending_hs.push((token, Instant::now() + d)); }