MINOR: htx: Split on DATA blocks only when blocks are moved to an HTX message

When htx_xfer_blks() is called to move blocks from an HTX message to another
one, most of blocks must be transferred atomically. But some may be splitted if
there is not enough space to move all the block. This was true for DATA and TLR
blocks. But it is a bad idea to split trailers. During HTTP parsing, only one
TLR block is emitted. It simplifies the processing of trailers to keep the block
untouched.

This patch must be backported to 1.9 because some fixes may depend on it.
This commit is contained in:
Christopher Faulet 2019-05-07 10:52:54 +02:00
parent cc5060217e
commit bc5770b91e

View File

@ -522,7 +522,7 @@ struct htx_ret htx_xfer_blks(struct htx *dst, struct htx *src, uint32_t count,
sz = max;
info = (type << 28) + sz;
/* Headers and pseudo headers must be fully copied */
if (type < HTX_BLK_DATA || !sz)
if (type != HTX_BLK_DATA || !sz)
break;
}