From bc5770b91e8c1c2f226851ed008d6642a80aef99 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 7 May 2019 10:52:54 +0200 Subject: [PATCH] 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. --- src/htx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htx.c b/src/htx.c index a98a3080c..62a175d9d 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; }