From 66e4be2fd0b47948b232f4a720fc8a9ac0ad8fb3 Mon Sep 17 00:00:00 2001 From: Tiburce GIROUX Date: Mon, 9 Nov 2026 19:13:37 +0100 Subject: [PATCH] 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. --- src/flt_decomp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.47.3