#define DECOMP_STATE_PROCESSING 0x01
#define DECOMP_STATE_EOM_SEEN 0x02
+#define DECOMP_STATE_DATA_SEEN 0x04 /* some payload data were received */
const char *decomp_req_flt_id = "decomp-req filter";
const char *decomp_res_flt_id = "decomp-res filter";
case HTX_BLK_UNUSED:
goto next;
case HTX_BLK_DATA:
+ st->flags |= DECOMP_STATE_DATA_SEEN;
if (blk->flags & HTX_BLK_FL_EOM) {
blk->flags &= ~HTX_BLK_FL_EOM;
st->flags |= DECOMP_STATE_EOM_SEEN;
/* there is still pending data that we need to drain */
break;
}
+ if (!(st->flags & DECOMP_STATE_DATA_SEEN)) {
+ /* The end of the payload is reached without any
+ * data. There is nothing to decompress, so it is
+ * an empty payload, not a truncated one. The
+ * decompression is finished.
+ */
+ st->decomp_ctx->flags |= DECOMP_CTX_FL_DONE;
+ }
if (!(st->decomp_ctx->flags & DECOMP_CTX_FL_DONE)) {
char *data = "";