]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: htx: Split on DATA blocks only when blocks are moved to an HTX message
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 08:52:54 +0000 (10:52 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 20:16:41 +0000 (22:16 +0200)
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

index a98a3080c89a030b77de800a733a819b88744305..62a175d9d4acbddbbe8c66e57c559ae5ff0cd506 100644 (file)
--- 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;
                }