From: Christopher Faulet Date: Thu, 26 Nov 2026 19:36:22 +0000 (+0100) Subject: MINOR: http-ana: remove the HTX defrag when waiting for a message payload X-Git-Url: https://git.kaiwu.me/http/%22..//%22?a=commitdiff_plain;h=b0d3ef63102b2273246daf47fa0cdee8afd7131c;p=haproxy.git MINOR: http-ana: remove the HTX defrag when waiting for a message payload When http_wait_for_msg_body() was introduced, an HTX defragmentation was performed on any fragmented or unordered message, hoping it would ease the payload analysis afterwards. In fact, this defrag is useless because the same condition is already handled by sc_conn_recv() and sc_applet_recv(), which defragment the HTX message on every receive when the buffer is stuck and the message is fragmented or its free space wraps. Thus, while we are waiting for the payload, the message is defragmented as soon as new data arrive. In addition, since the previous commit, the sample fetches retrieving the body from an HTX message now defrag it themselves if needed. So there is no consumer left relying on the message being defragmented when the wait ends. This defrag was introduced in 3.4 with the commit f559c202f ("MINOR: http-ana: Do a defrag on unaligned HTX message when waiting for payload"). Given its speculative nature, it does not need to be backported. --- diff --git a/src/http_ana.c b/src/http_ana.c index b85dec1c4..8282949bf 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -4497,8 +4497,6 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn, if (ret != HTTP_RULE_RES_YIELD) chn->analyse_exp = TICK_ETERNITY; - if (htx->flags & (HTX_FL_FRAGMENTED|HTX_FL_UNORDERED)) - htx_defrag(htx, NULL, 0); return ret; abort: