]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: listeners: Update the frequency counters separately when needed
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 3 Mar 2026 17:55:17 +0000 (18:55 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 5 Mar 2026 14:39:42 +0000 (15:39 +0100)
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.

src/listener.c

index 4f35878b5edca04423b48de38e1409c86c820ab6..187c0b42c6a441f7bbfd3365181c2f7627daf8d8 100644 (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);
                        }
                }
        }