BUG/MINOR: proxy: only use proxy_inc_fe_cum_sess_ver_ctr() with frontends
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 2 May 2025 17:06:44 +0000 (19:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:43 +0000 (17:01 +0200)
commit736bb497acb656e736291f8113650a62bcf96f5f
treef8bc0d146aefd859f3a389746995152cbd1eb096
parentc942bb9c88a40265d308b42fcba59ef61ea0d4e6
BUG/MINOR: proxy: only use proxy_inc_fe_cum_sess_ver_ctr() with frontends

proxy_inc_fe_cum_sess_ver_ctr() was implemented in 9969adbc
("MINOR: stats: add by HTTP version cumulated number of sessions and
requests")

As its name suggests, it is meant to be called for frontends, not backends

Also, in 9969adbc, when used under h1_init(), a precaution is taken to
ensure that the function is only called with frontends.

However, this precaution was not applied in h2_init() and qc_init().

Due to this, it remains possible to have proxy_inc_fe_cum_sess_ver_ctr()
being called with a backend proxy as parameter. While it did not cause
known issues so far, it is not expected and could result in bugs in the
future. Better fix this by ensuring the function is only called with
frontends.

It may be backported up to 2.8

(cherry picked from commit b39825ee45150415d7ed64b7ce785bb946f727bd)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h2.c
src/mux_quic.c