From ad08f80596717c76da651346cf740834da38b313 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 7 Oct 2026 11:29:35 +0200 Subject: [PATCH] BUG/MINOR: mux-h1: don't report a 408 error on timeout of a closed connection When a frontend connection times out, the mux H1 tries to send a 408 error to the client unless the connection is in the CLOSING state. But a connection may also be in the CLOSED state, waiting the client closes on its side. In that case too, no 408 must be emitted. Because of this issue, the failed requests counters are incremented, a "408 " log line is emitted while it should not. Now the error is only sent if the connection is still alive. It should be backported as far as 2.8. --- src/mux_h1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 27b96e427..dc50929e7 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -4656,8 +4656,10 @@ struct task *h1_timeout_task(struct task *t, void *context, unsigned int state) return t; } - /* Try to send an error to the client */ - if (h1c->state != H1_CS_CLOSING && !(h1c->flags & (H1C_F_IS_BACK|H1C_F_ERROR|H1C_F_ABRT_PENDING))) { + /* Try to send an error to the client, unless the connection is + * already closing or closed (i.e. shut down for writes). + */ + if (h1_is_alive(h1c) && !(h1c->flags & (H1C_F_IS_BACK|H1C_F_ERROR|H1C_F_ABRT_PENDING))) { TRACE_DEVEL("timeout error detected", H1_EV_H1C_WAKE|H1_EV_H1C_ERR, h1c->conn, h1c->h1s); if (h1_handle_req_tout(h1c)) h1_send(h1c); -- 2.47.3