From: Christopher Faulet Date: Thu, 3 Dec 2026 14:59:06 +0000 (+0100) Subject: MINOR: htx: don't mark the message unordered when data follow a NOOP block X-Git-Url: https://git.kaiwu.me/web/http/virtual_hosts.html?a=commitdiff_plain;h=cdc01bf1e3c6c38b2f4fceb799d3f5f8c371d0d8;p=haproxy.git MINOR: htx: don't mark the message unordered when data follow a NOOP block When data are added after a block of a greater type, the HTX message is marked as unordered. But a NOOP block may be found anywhere in a message. So data added after a NOOP block without EOM must not be considered as unordered. Otherwise a useless defragmentation may be performed. --- diff --git a/src/htx.c b/src/htx.c index 10bd40498..29e419d40 100644 --- a/src/htx.c +++ b/src/htx.c @@ -636,7 +636,10 @@ struct htx_blk *__htx_add_data_type_atonce(struct htx *htx, struct ist data, enu if (tailblk->flags & HTX_BLK_FL_EOM) goto add_new_block; if (htx_get_blk_type(tailblk) != type) { - if (htx_get_blk_type(tailblk) > type) + /* A NOOP block may be found anywhere, so it does not make the + * message unordered. + */ + if (htx_get_blk_type(tailblk) > type && htx_get_blk_type(tailblk) != HTX_BLK_NOOP) flags |= HTX_FL_UNORDERED; goto add_new_block; } @@ -1153,7 +1156,10 @@ struct htx_ret htx_reserve_max_data(struct htx *htx) if (tailblk->flags & HTX_BLK_FL_EOM) goto rsv_new_block; if (htx_get_blk_type(tailblk) != HTX_BLK_DATA) { - if (htx_get_blk_type(tailblk) > HTX_BLK_DATA) + /* A NOOP block may be found anywhere, so it does not make the + * message unordered. + */ + if (htx_get_blk_type(tailblk) > HTX_BLK_DATA && htx_get_blk_type(tailblk) != HTX_BLK_NOOP) flags |= HTX_FL_UNORDERED; goto rsv_new_block; } @@ -1237,7 +1243,10 @@ size_t htx_add_data_type(struct htx *htx, const struct ist data, enum htx_blk_ty if (tailblk->flags & HTX_BLK_FL_EOM) goto add_new_block; if (htx_get_blk_type(tailblk) != type) { - if (htx_get_blk_type(tailblk) > type) + /* A NOOP block may be found anywhere, so it does not make the + * message unordered. + */ + if (htx_get_blk_type(tailblk) > type && htx_get_blk_type(tailblk) != HTX_BLK_NOOP) flags |= HTX_FL_UNORDERED; goto add_new_block; }