Skip to content

Commit

Permalink
MINOR: mux-quic/h3: count glitches when they're reported
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wtarreau committed Nov 14, 2024
1 parent 42710b7 commit 4fd6d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion include/haproxy/mux_quic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
#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);
Expand Down
2 changes: 1 addition & 1 deletion src/mux_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4fd6d15

Please sign in to comment.