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.
This commit is contained in:
Olivier Houchard 2026-03-03 18:55:17 +01:00 committed by Olivier Houchard
parent 0087651128
commit 88bc2bdfc9

View file

@ -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);
}
}
}