From: Tiburce GIROUX Date: Mon, 9 Nov 2026 18:13:37 +0000 (+0100) Subject: BUG/MEDIUM: flt-decomp: preserve pending output before decoding again X-Git-Url: https://git.kaiwu.me/$%7BGITURL%7D$%7Bcid%7D?a=commitdiff_plain;h=66e4be2fd0b47948b232f4a720fc8a9ac0ad8fb3;p=haproxy.git BUG/MEDIUM: flt-decomp: preserve pending output before decoding again The HTTP no-input path tries to drain the decompressor's pending output, then may call add_data() with an empty input even when the drain was only partial. decomp_uslz_add_data() replaces drain and drain_len with the new result, so this can discard output that has not yet been forwarded. Only call the decoder again after the previous output has been fully drained, as the TCP decompression path already does. --- diff --git a/src/flt_decomp.c b/src/flt_decomp.c index 670095845..8c1823439 100644 --- a/src/flt_decomp.c +++ b/src/flt_decomp.c @@ -382,7 +382,8 @@ static int decomp_stream_blk(struct stream *s, struct filter *f, struct channel ret = decomp_stream_blk_drain(s, f, chn, NULL, NULL, 0); total += ret; - if (!(st->decomp_ctx->flags & DECOMP_CTX_FL_DONE)) { + if (!st->decomp_ctx->drain_len && + !(st->decomp_ctx->flags & DECOMP_CTX_FL_DONE)) { char *data = ""; /* ensure there isn't remaining data in the decomp state buffer: