From: Christopher Faulet Date: Fri, 11 Sep 2026 13:42:50 +0000 (+0200) Subject: MEDIUM: htx: Remove usless htx_is_unique_blk() function X-Git-Tag: v3.5-dev8~154 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=7420438306e14fd5b65fff7b9a9be62ff5491ee8;p=haproxy.git MEDIUM: htx: Remove usless htx_is_unique_blk() function Tagged as MEDIUM while it is only a code cleanup, but this function may still be used by external code. It is an API change. This function is no longer used but it is also useless. Indeed, thanks to recent changes, it is not possible to have unused HTX blocks on head and tail of the message. So, htx_is_unique_blk() can be replaced by a test on the number of blocks in the message. In addition, this function was almost always used to know if the EOM flag on the message can be processed. Now, the info is on the block itself. So no reason to still use this function. It should disappear naturally with modifications to handle all recent changes. So, let's remove it now. --- diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index c22c3dbf6..234dfc587 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -368,16 +368,6 @@ static inline enum htx_blk_type htx_get_first_type(const struct htx *htx) return (blk ? htx_get_blk_type(blk) : HTX_BLK_UNUSED); } -/* Returns 1 if is the block is the only one inside the HTX message , - * excluding all unused blocks. Otherwise, it returns 0. If 1 is returned, this - * means that there is only and eventually some unused ones in . - */ -static inline int htx_is_unique_blk(const struct htx *htx, - const struct htx_blk *blk) -{ - return (htx_get_blksz(blk) == htx->data); -} - /* Changes the size of the value. It is the caller responsibility to change the * value itself, make sure there is enough space and update allocated * value. This function updates the HTX message accordingly.