From: Maxime Henrion Date: Fri, 10 Jul 2026 21:55:28 +0000 (-0400) Subject: CLEANUP: cache: align the cache_hint_hits increment with its siblings X-Git-Url: http://git.kaiwu.me/web/%22data:,/static/$%7BGITURL%7D/1?a=commitdiff_plain;ds=inline;p=haproxy.git CLEANUP: cache: align the cache_hint_hits increment with its siblings For the sake of consistency, increment cache_hint_hits the same way as the surrounding cache counters instead of going through a temporary pointer. No functional change, and nothing to backport. --- diff --git a/src/cache.c b/src/cache.c index da56966b7..319396b00 100644 --- a/src/cache.c +++ b/src/cache.c @@ -2657,17 +2657,14 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p if (hint_buf && b_data(hint_buf) > 0 && cache_emit_early_hints(s, b_orig(hint_buf), b_data(hint_buf))) { - long long *ctr = NULL; - if (px == strm_fe(s)) { if (px->fe_counters.shared.tg) - ctr = &px->fe_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits; + _HA_ATOMIC_INC(&px->fe_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits); + } + else { + if (px->be_counters.shared.tg) + _HA_ATOMIC_INC(&px->be_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits); } - else if (px->be_counters.shared.tg) - ctr = &px->be_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits; - - if (ctr) - _HA_ATOMIC_INC(ctr); } /* In case of Vary, we could have multiple entries with the same