MINOR: counters: Review conditions to increment counters from analysers
Now, for these counters, the following rules are followed to know if it must be
incremented or not:
* if it exists for a frontend, the counter is incremented
* if stats must be collected for the session's listener, if the counter exists
for this listener, it is incremented
* if the backend is already assigned, if the counter exists for this backend,
it is incremented
* if a server is attached to the stream, if the counter exists for this
server, it is incremented
It is not hardcoded rules. Some counters are still handled in a different
way. But many counters are incremented this way now.
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index 2e01cdb..f7108c3 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -474,10 +474,11 @@
rewrite_err:
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_rewrites, 1);
- if (sess->fe != s->be)
- _HA_ATOMIC_ADD(&s->be->be_counters.failed_rewrites, 1);
+ _HA_ATOMIC_ADD(&s->be->be_counters.failed_rewrites, 1);
if (sess->listener->counters)
_HA_ATOMIC_ADD(&sess->listener->counters->failed_rewrites, 1);
+ if (objt_server(s->target))
+ _HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_rewrites, 1);
hdr_rule_err:
node = ebpt_first(&hdr_rules);
while (node) {