From: Christopher Faulet Date: Thu, 3 Dec 2026 09:10:49 +0000 (+0100) Subject: BUG/MINOR: http-ana: don't stop waiting for the body on a NOOP block X-Git-Url: https://git.kaiwu.me/web/http/static/%7B@url%7D?a=commitdiff_plain;h=7fefd2d7cbc8faee30bf1156bd6338da9e6ecc94;p=haproxy.git BUG/MINOR: http-ana: don't stop waiting for the body on a NOOP block In http_wait_for_msg_body(), all the payload was considered as received when the tail block of the HTX message was of a type greater than HTX_BLK_DATA, to detect the trailers. But since the commit 221c40bbf ("MINOR: htx: Add a noop block to carry the EOM flag on an empty message"), a NOOP block may be found anywhere in the message and its type is greater than HTX_BLK_DATA. So a NOOP block without the EOM flag at the end of the message stopped the wait, the rules being evaluated on a partial payload. For now, such block can only be produced by the HTTPMessage:unset_eom() Lua function. Now, only TLR and EOT blocks are considered. This patch must be backported to 3.5. --- diff --git a/src/http_ana.c b/src/http_ana.c index c2f23821d..87ed66e5f 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -4462,9 +4462,13 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn, } /* Now we're are waiting for the payload. We just need to know if all - * data have been received or if the buffer is full. + * data have been received or if the buffer is full. All data were + * received if the end of the message was reached or if the trailers + * were received. Note a NOOP block may be found anywhere in the + * message, so it must not be considered here. */ - if (htx_msg_ended(htx) || htx_get_tail_type(htx) > HTX_BLK_DATA) + if (htx_msg_ended(htx) || + htx_get_tail_type(htx) == HTX_BLK_TLR || htx_get_tail_type(htx) == HTX_BLK_EOT) goto end; /* all data received */ if (bytes) {