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.
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: