From: Olivier Houchard Date: Tue, 3 Mar 2026 17:55:17 +0000 (+0100) Subject: MINOR: listeners: Update the frequency counters separately when needed X-Git-Tag: v3.4-dev6~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88bc2bdfc9dc14bf6ca89aa01ef92719ee85bd46;p=thirdparty%2Fhaproxy.git MINOR: listeners: Update the frequency counters separately when needed Update the frequency counters that are exported to the stats page outside of the call to COUNTERS_UPDATE_MAX(), so that they will happen even if COUNTERS_UPDATE_MAX() ends up doing nothing. --- diff --git a/src/listener.c b/src/listener.c index 4f35878b5..187c0b42c 100644 --- a/src/listener.c +++ b/src/listener.c @@ -172,11 +172,12 @@ struct task *accept_queue_process(struct task *t, void *context, unsigned int st * connection. */ if (!(li->bind_conf->options & BC_O_UNLIMITED)) { - COUNTERS_UPDATE_MAX(&global.sps_max, - update_freq_ctr(&global.sess_per_sec, 1)); + uint newfreq = update_freq_ctr(&global.sess_per_sec, 1); + + COUNTERS_UPDATE_MAX(&global.sps_max, newfreq); if (li->bind_conf->options & BC_O_USE_SSL) { - COUNTERS_UPDATE_MAX(&global.ssl_max, - update_freq_ctr(&global.ssl_per_sec, 1)); + newfreq = update_freq_ctr(&global.ssl_per_sec, 1); + COUNTERS_UPDATE_MAX(&global.ssl_max, newfreq); } } }