From: Christopher Faulet Date: Tue, 7 May 2019 08:52:54 +0000 (+0200) Subject: MINOR: htx: Split on DATA blocks only when blocks are moved to an HTX message X-Git-Tag: v2.0-dev3~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc5770b91e8c1c2f226851ed008d6642a80aef99;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/htx.c b/src/htx.c index a98a3080c8..62a175d9d4 100644 --- a/src/htx.c +++ b/src/htx.c @@ -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; }