mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-15 12:01:12 -04:00
CLEANUP: cache: align the cache_hint_hits increment with its siblings
Some checks failed
Contrib / admin/halog/ (push) Has been cancelled
Contrib / dev/flags/ (push) Has been cancelled
Contrib / dev/haring/ (push) Has been cancelled
Contrib / dev/hpack/ (push) Has been cancelled
Contrib / dev/poll/ (push) Has been cancelled
FreeBSD / clang (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled
Some checks failed
Contrib / admin/halog/ (push) Has been cancelled
Contrib / dev/flags/ (push) Has been cancelled
Contrib / dev/haring/ (push) Has been cancelled
Contrib / dev/hpack/ (push) Has been cancelled
Contrib / dev/poll/ (push) Has been cancelled
FreeBSD / clang (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled
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.
This commit is contained in:
parent
8d2381c5ee
commit
5468ef0d75
1 changed files with 5 additions and 8 deletions
13
src/cache.c
13
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue