]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: http_htx: rename inner 'type' to 'ptype' to avoid variable shadowing
authorWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 12:39:16 +0000 (14:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 14:04:19 +0000 (16:04 +0200)
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".

src/http_htx.c

index 9e43d4e0423c7bd1c1ccb50d42d3ab66ddb5aa1f..5db9fe17c0c2923beea862359fdc0fad64ac7298 100644 (file)
@@ -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;