From: Christopher Faulet Date: Wed, 2 Sep 2026 12:45:13 +0000 (+0200) Subject: BUG/MINOR: flt-http-comp: Rely on htx_set_eom() to restore EOM flag X-Git-Tag: v3.5-dev7~78 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=8f6bf96f992ad746d65600ecf6f60f08a122b3c9;p=haproxy.git BUG/MINOR: flt-http-comp: Rely on htx_set_eom() to restore EOM flag A theoritical bug was introduced by the commit 30890fd90 ("BUG/MEDIUM: flt-http-comp: Block HTX_FL_EOM flag till the end of compression"). On the normal case, the HTX_FL_EOM flag was restored without checking if the HTX message was empty or not. It could be an issue. Instead, htx_set_eom() function must be used. This patch must be backported with the commit above. --- diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index ed0b83f24..534ee5f38 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -381,8 +381,12 @@ comp_http_payload(struct stream *s, struct filter *filter, struct http_msg *msg, /* The compression is finished and we must now restore the EOM flog on * the HTX message. */ - if ((st->flags & (COMP_STATE_PROCESSING|COMP_STATE_EOM_SEEN)) == COMP_STATE_EOM_SEEN) - htx->flags |= HTX_FL_EOM; + if ((st->flags & (COMP_STATE_PROCESSING|COMP_STATE_EOM_SEEN)) == COMP_STATE_EOM_SEEN) { + unsigned int data = htx->data; + + htx_set_eom(htx); + to_forward += htx->data - data; + } if (to_forward != consumed) flt_update_offsets(filter, msg->chn, to_forward - consumed);