Before commit
0a9ecebda ("MEDIUM: htx: Insert headers and trailers
before corresponding end-of block") in 3.5-dev8, htx_add_header() and
htx_add_trailer() set HTX_FL_UNORDERED when the block was added after
the end-of-headers or end-of-trailers block, since its payload is then
located after the ones of the following blocks. The new code now moves
the block before the end-of block, but doesn't set this flag anymore
while the payloads are still unordered. The flag is used to decide to
defragment the message in the body sample fetches (req.body,
res.body, req.body_param...), so that DATA blocks may be merged and the
body retrieved without copy. Without it, this optimization is skipped. This
is not a correctness issue, but a performance regression.
Let's set the flag again when the new block is moved.
This patch should be backported to 3.5.
blk->addr ^= prevblk->addr; prevblk->addr ^= blk->addr; blk->addr ^= prevblk->addr;
blk->info ^= prevblk->info; prevblk->info ^= blk->info; blk->info ^= prevblk->info;
blk = prevblk;
+
+ /* the payloads are not in the blocks order anymore */
+ htx->flags |= HTX_FL_UNORDERED;
}
/* The new block was moved before any block of a greater type, and the
blk->addr ^= prevblk->addr; prevblk->addr ^= blk->addr; blk->addr ^= prevblk->addr;
blk->info ^= prevblk->info; prevblk->info ^= blk->info; blk->info ^= prevblk->info;
blk = prevblk;
+
+ /* the payloads are not in the blocks order anymore */
+ htx->flags |= HTX_FL_UNORDERED;
}
/* The new block was moved before any block of a greater type, and the