From: Christopher Faulet Date: Thu, 3 Dec 2026 08:34:46 +0000 (+0100) Subject: BUG/MINOR: mux-h1: skip raw data after a rejected CONNECT again X-Git-Url: https://git.kaiwu.me/web/http/static/%7B@url%7D?a=commitdiff_plain;h=b7ee75bfb8fa66af7928a93edbbba33f84f722aa;p=haproxy.git BUG/MINOR: mux-h1: skip raw data after a rejected CONNECT again Since the commit e99253b70 ("BUG/MINOR: mux-h1: properly handle NOOP blocks and track EOM emission"), RAW_DATA blocks found in DONE state on the backend side are only skipped if the end of the request was sent, the H1S_F_EOM_SENT flag being set. But this flag was never set for a CONNECT request. In h1_make_eoh(), the CONNECT case is handled before the EOM flag is tested, even if the EOH block carries the EOM flag, which is always the case for a CONNECT request received from an H1 or an H2 client. So when a CONNECT was rejected by the server, early tunnel data still pending in the request buffer were rejected with a processing error instead of being silently skipped. It was a regression of the commit 04456142e ("BUG/MINOR: mux-h1: Discard pending raw data after a tunnel rejection"). Now, the H1S_F_EOM_SENT flag is set for a CONNECT request when the EOH block carries the EOM flag. This patch must be backported to 3.5. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index d90f8271a..b803c5eab 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3036,8 +3036,13 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz if (!chunk_memcat(&outbuf, "\r\n", 2)) goto full; /* a CONNECT request was sent. Output processing is now blocked - * waiting the server response. + * waiting the server response. The request ends at its headers. + * If the EOH block carries the EOM flag, the end of the message + * was reached and must be tracked: tunneled data may follow and + * must be skipped if the tunnel is rejected. */ + if (blk->flags & HTX_BLK_FL_EOM) + h1s->flags |= H1S_F_EOM_SENT; h1m->state = H1_MSG_DONE; h1s->flags |= H1S_F_TX_BLK; TRACE_STATE("CONNECT request waiting for tunnel mode", H1_EV_TX_DATA|H1_EV_H1S_BLK, h1c->conn, h1s);