From ad6f5987b4467f0b54d5dcb13503b00d15fda75e Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 18 Sep 2024 15:33:30 +0200 Subject: [PATCH] BUG/MINOR: mux-quic: report glitches to session Glitch counter was implemented for QUIC/HTTP3. The counter is stored in the QCC MUX connection instance. However, this is never reported at the session level which is necessary if glitch counter is tracked via a stick-table. To fix this, use session_add_glitch_ctr() in various QUIC MUX functions which may increment glitch counter. This should be backported up to 3.0. (cherry picked from commit fcd6d29acf108c55e1e1c17c04aeae621327adff) Signed-off-by: Christopher Faulet --- src/mux_quic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mux_quic.c b/src/mux_quic.c index 668f3f2..98e737f 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -934,6 +935,7 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs) struct buffer b; ssize_t ret; int fin = 0; + int prev_glitches = qcc->glitches; TRACE_ENTER(QMUX_EV_QCS_RECV, qcc->conn, qcs); @@ -945,6 +947,10 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs) if (!(qcs->flags & QC_SF_READ_ABORTED)) { ret = qcc->app_ops->rcv_buf(qcs, &b, fin); + + if (qcc->glitches != prev_glitches) + session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches); + if (ret < 0) { TRACE_ERROR("decoding error", QMUX_EV_QCS_RECV, qcc->conn, qcs); goto err; @@ -1482,6 +1488,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max) int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t final_size) { struct qcs *qcs; + int prev_glitches = qcc->glitches; TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn); @@ -1540,6 +1547,9 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f qcs_free_ncbuf(qcs, &qcs->rx.ncbuf); out: + if (qcc->glitches != prev_glitches) + session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches); + TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn); return 0; @@ -1557,6 +1567,7 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err) { struct qcs *qcs; + int prev_glitches = qcc->glitches; TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn); @@ -1642,6 +1653,9 @@ int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err) qcc_refresh_timeout(qcc); out: + if (qcc->glitches != prev_glitches) + session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches); + TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn); return 0; -- 1.7.10.4