diff --git a/src/backend.c b/src/backend.c index fc0066665..88991a828 100644 --- a/src/backend.c +++ b/src/backend.c @@ -347,7 +347,7 @@ static struct server *get_server_ph_post(struct stream *s, const struct server * p = params = NULL; len = 0; - for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) { + for (blk = htx_get_first_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) { enum htx_blk_type type = htx_get_blk_type(blk); struct ist v; diff --git a/src/cache.c b/src/cache.c index 188efea17..1fec57e24 100644 --- a/src/cache.c +++ b/src/cache.c @@ -715,7 +715,7 @@ enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px, } chunk_reset(&trash); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); uint32_t sz = htx_get_blksz(blk); diff --git a/src/da.c b/src/da.c index 6c7ce814e..f5e013528 100644 --- a/src/da.c +++ b/src/da.c @@ -307,7 +307,7 @@ static int da_haproxy_fetch(const struct arg *args, struct sample *smp, const ch } i = 0; - for (blk = htx_get_head_blk(htx); nbh < DA_MAX_HEADERS && blk; blk = htx_get_next_blk(htx, blk)) { + for (blk = htx_get_first_blk(htx); nbh < DA_MAX_HEADERS && blk; blk = htx_get_next_blk(htx, blk)) { size_t vlen; char *pval; da_evidence_id_t evid; diff --git a/src/filters.c b/src/filters.c index 95ba7728b..62e256ee9 100644 --- a/src/filters.c +++ b/src/filters.c @@ -933,7 +933,7 @@ flt_analyze_http_headers(struct stream *s, struct channel *chn, unsigned int an_ struct htx *htx = htxbuf(&chn->buf); int32_t pos; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); c_adv(chn, htx_get_blksz(blk)); if (htx_get_blk_type(blk) == HTX_BLK_EOH) diff --git a/src/flt_trace.c b/src/flt_trace.c index ed159e8a7..3a1424489 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -422,7 +422,7 @@ trace_http_headers(struct stream *s, struct filter *filter, HTX_SL_P2_LEN(sl), HTX_SL_P2_PTR(sl), HTX_SL_P3_LEN(sl), HTX_SL_P3_PTR(sl)); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; diff --git a/src/hlua.c b/src/hlua.c index 72ce6bab6..bb8c93da6 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3993,7 +3993,7 @@ static int hlua_applet_http_new(lua_State *L, struct appctx *ctx) lua_settable(L, -3); } - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -4210,7 +4210,7 @@ __LJMP static int hlua_applet_htx_getline_yield(lua_State *L, int status, lua_KC htx = htx_from_buf(&req->buf); count = co_data(req); - blk = htx_get_head_blk(htx); + blk = htx_get_first_blk(htx); while (count && !stop && blk) { enum htx_blk_type type = htx_get_blk_type(blk); @@ -4366,7 +4366,7 @@ __LJMP static int hlua_applet_htx_recv_yield(lua_State *L, int status, lua_KCont htx = htx_from_buf(&req->buf); len = MAY_LJMP(luaL_checkinteger(L, 2)); count = co_data(req); - blk = htx_get_head_blk(htx); + blk = htx_get_first_blk(htx); while (count && len && blk) { enum htx_blk_type type = htx_get_blk_type(blk); uint32_t sz = htx_get_blksz(blk); @@ -5197,7 +5197,7 @@ __LJMP static int hlua_http_get_headers(lua_State *L, struct hlua_txn *htxn, str struct htx *htx = htxbuf(&msg->chn->buf); int32_t pos; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; @@ -7213,7 +7213,7 @@ static void hlua_applet_htx_fct(struct appctx *ctx) * the Lua. */ req_htx = htx_from_buf(&req->buf); - blk = htx_get_head_blk(req_htx); + blk = htx_get_first_blk(req_htx); while (count && blk) { enum htx_blk_type type = htx_get_blk_type(blk); uint32_t sz = htx_get_blksz(blk); diff --git a/src/http_fetch.c b/src/http_fetch.c index 0a5a2f91f..395e665e9 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -615,7 +615,7 @@ static int smp_fetch_hdrs(const struct arg *args, struct sample *smp, const char if (!htx) return 0; temp = get_trash_chunk(); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -687,7 +687,7 @@ static int smp_fetch_hdrs_bin(const struct arg *args, struct sample *smp, const temp = get_trash_chunk(); p = temp->area; end = temp->area + temp->size; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; @@ -844,7 +844,7 @@ static int smp_fetch_body(const struct arg *args, struct sample *smp, const char return 0; temp = get_trash_chunk(); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -915,7 +915,7 @@ static int smp_fetch_body_len(const struct arg *args, struct sample *smp, const if (!htx) return 0; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -963,7 +963,7 @@ static int smp_fetch_body_size(const struct arg *args, struct sample *smp, const if (!htx) return 0; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -1281,7 +1281,7 @@ static int smp_fetch_hdr_names(const struct arg *args, struct sample *smp, const del = *args[0].data.str.area; temp = get_trash_chunk(); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n; @@ -2590,7 +2590,7 @@ static int smp_fetch_body_param(const struct arg *args, struct sample *smp, cons return 0; temp = get_trash_chunk(); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); diff --git a/src/http_htx.c b/src/http_htx.c index 8099071d4..15865d502 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -80,7 +80,7 @@ int http_find_header(const struct htx *htx, const struct ist name, if (!htx->used) return 0; - for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) { + for (blk = htx_get_first_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) { rescan_hdr: type = htx_get_blk_type(blk); if (type == HTX_BLK_EOH || type == HTX_BLK_EOM) @@ -143,7 +143,7 @@ int http_add_header(struct htx *htx, const struct ist n, const struct ist v) /* is the head, swap it iteratively with its predecessor to place * it just before the end-of-header block. So blocks remains ordered. */ - for (prev = htx_get_prev(htx, htx->tail); prev != -1; prev = htx_get_prev(htx, prev)) { + for (prev = htx_get_prev(htx, htx->tail); prev != htx->sl_pos; 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); diff --git a/src/proto_htx.c b/src/proto_htx.c index 35039fc53..dbbd937bd 100644 --- a/src/proto_htx.c +++ b/src/proto_htx.c @@ -300,7 +300,7 @@ int htx_wait_for_request(struct stream *s, struct channel *req, int an_bit) htx_debug_stline("clireq", s, sl); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -1655,7 +1655,7 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit) htx_debug_stline("srvrep", s, sl); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); @@ -3531,7 +3531,7 @@ static int htx_apply_filter_to_req_headers(struct stream *s, struct channel *req htx = htxbuf(&req->buf); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type; struct ist n, v; @@ -3749,7 +3749,7 @@ static int htx_apply_filter_to_resp_headers(struct stream *s, struct channel *re htx = htxbuf(&res->buf); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type; struct ist n, v; @@ -4643,7 +4643,7 @@ void htx_check_request_for_cacheability(struct stream *s, struct channel *req) htx = htxbuf(&req->buf); pragma_found = cc_found = 0; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; @@ -4731,7 +4731,7 @@ void htx_check_response_for_cacheability(struct stream *s, struct channel *res) } htx = htxbuf(&res->buf); - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; @@ -5564,7 +5564,7 @@ static void htx_capture_headers(struct htx *htx, char **cap, struct cap_hdr *cap struct cap_hdr *h; int32_t pos; - for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) { + for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) { struct htx_blk *blk = htx_get_blk(htx, pos); enum htx_blk_type type = htx_get_blk_type(blk); struct ist n, v; diff --git a/src/stats.c b/src/stats.c index 7d9a8a3a7..a8f9795c9 100644 --- a/src/stats.c +++ b/src/stats.c @@ -2788,7 +2788,7 @@ static int stats_process_http_post(struct stream_interface *si) } /* The request was fully received. Copy data */ - blk = htx_get_head_blk(htx); + blk = htx_get_first_blk(htx); while (blk) { enum htx_blk_type type = htx_get_blk_type(blk);