]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic/h3: count glitches when they're reported
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Nov 2024 14:38:25 +0000 (15:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Nov 2024 19:43:33 +0000 (20:43 +0100)
The qcc_report_glitch() function is now replaced with a macro to support
enumerating counters for each individual glitch line. For now this adds
36 such counters. The macro supports an optional description, though that
is not being used for now.

As a reminder, this requires to build with -DDEBUG_GLITCHES=1.

include/haproxy/mux_quic.h
src/mux_quic.c

index cc5eb1e96a51c4f75ccade0e1f341150f597f784..6e497c700a84c39fe1463eeb3a73291a082aec4c 100644 (file)
 #include <haproxy/mux_quic-t.h>
 #include <haproxy/stconn.h>
 
+#define qcc_report_glitch(qcc, inc, ...) ({            \
+               COUNT_GLITCH(__VA_ARGS__);              \
+               _qcc_report_glitch(qcc, inc);           \
+       })
+
 void qcc_set_error(struct qcc *qcc, int err, int app);
-int qcc_report_glitch(struct qcc *qcc, int inc);
+int _qcc_report_glitch(struct qcc *qcc, int inc);
 struct qcs *qcc_init_stream_local(struct qcc *qcc, int bidi);
 void qcs_send_metadata(struct qcs *qcs);
 struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin);
index 84f92c55b86c27d1d2baef8203bba8a4810da161..d704403d303ff5138f9352337dbf8e6f60690e43 100644 (file)
@@ -718,7 +718,7 @@ void qcc_set_error(struct qcc *qcc, int err, int app)
 /* Increment glitch counter for <qcc> connection by <inc> steps. If configured
  * threshold reached, close the connection with an error code.
  */
-int qcc_report_glitch(struct qcc *qcc, int inc)
+int _qcc_report_glitch(struct qcc *qcc, int inc)
 {
        const int max = global.tune.quic_frontend_glitches_threshold;