From: Willy Tarreau Date: Mon, 11 May 2026 12:39:16 +0000 (+0200) Subject: CLEANUP: http_htx: rename inner 'type' to 'ptype' to avoid variable shadowing X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=fa9cefd277cd02726d51eb0dda9e5ba79270da87;p=haproxy.git CLEANUP: http_htx: rename inner 'type' to 'ptype' to avoid variable shadowing In http_add_header() there are "type" variables of the same type at two levels, which is a bit confusing. The inner one is for the "prev" block, so let's rename it "ptype" by analogy with "pblk". --- diff --git a/src/http_htx.c b/src/http_htx.c index 9e43d4e04..5db9fe17c 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -301,7 +301,7 @@ int http_add_header(struct htx *htx, const struct ist n, const struct ist v, int * it just before the end-of-header block. So blocks remains ordered. */ for (prev = htx_get_prev(htx, htx->tail); prev != htx->first; prev = htx_get_prev(htx, prev)) { struct htx_blk *pblk = htx_get_blk(htx, prev); - enum htx_blk_type type = htx_get_blk_type(pblk); + enum htx_blk_type ptype = htx_get_blk_type(pblk); /* Swap .addr and .info fields */ blk->addr ^= pblk->addr; pblk->addr ^= blk->addr; blk->addr ^= pblk->addr; @@ -311,7 +311,7 @@ int http_add_header(struct htx *htx, const struct ist n, const struct ist v, int blk->addr += htx_get_blksz(pblk); /* Stop when end-of-header is reached */ - if (type == HTX_BLK_EOH) + if (ptype == HTX_BLK_EOH) break; blk = pblk;