From: Christopher Faulet Date: Thu, 23 Jul 2026 08:58:58 +0000 (+0200) Subject: MINOR: mux-h1: loop on HTX blocks using _blk() functions to look for WS key X-Git-Tag: v3.5-dev7~72 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=36a9541c635b0f1951903cdcae9647d2eb43cb24;p=haproxy.git MINOR: mux-h1: loop on HTX blocks using _blk() functions to look for WS key In h1_search_websocket_key() function, instead of looping on the block position, we now use functions returning a blocks. This commit is mandatory for next changes. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index b412cacb0..f19113512 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1927,11 +1927,10 @@ static int h1_search_websocket_key(struct h1s *h1s, struct h1m *h1m, struct htx struct htx_blk *blk; enum htx_blk_type type; struct ist n, v; - int ws_key_found = 0, idx; + int ws_key_found = 0; - idx = htx_get_head(htx); // returns the SL that we skip - while ((idx = htx_get_next(htx, idx)) != -1) { - blk = htx_get_blk(htx, idx); + blk = htx_get_head_blk(htx); // returns the SL that we skip + for (blk = htx_get_next_blk(htx, blk); blk; blk = htx_get_next_blk(htx, blk)) { type = htx_get_blk_type(blk); if (type == HTX_BLK_UNUSED)