]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: add trace event for local error
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 4 May 2023 13:16:01 +0000 (15:16 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 4 May 2023 14:36:51 +0000 (16:36 +0200)
Add a dedicated trace event QMUX_EV_QCC_ERR. This is used for locally
detected error when a CONNECTION_CLOSE should be emitted.

This should be backported up to 2.7.

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

index 0bc89a31852989cd0a167e568afd19135b26892b..ff850f0c0b84ffc571d697cf92a0a3f500f16aa6 100644 (file)
@@ -48,6 +48,8 @@ static const struct trace_event qmux_trace_events[] = {
        { .mask = QMUX_EV_QCS_BUILD_STRM, .name = "qcs_build_stream_frm", .desc = "qcs_build_stream_frm" },
 #define           QMUX_EV_PROTO_ERR     (1ULL << 17)
        { .mask = QMUX_EV_PROTO_ERR,    .name = "proto_err",    .desc = "protocol error" },
+#define           QMUX_EV_QCC_ERR       (1ULL << 18)
+       { .mask = QMUX_EV_QCC_ERR,      .name = "qcc_err",      .desc = "connection on error" },
        { }
 };
 
index bd67417019ace468fc04741a040e97d0ba676110..7adb121c8abaf98be412b678ab73c7e4001fb98f 100644 (file)
@@ -34,7 +34,7 @@ static void qcc_emit_cc(struct qcc *qcc, int err)
        /* This function must not be called multiple times. */
        BUG_ON(qcc->flags & QC_CF_CC_EMIT);
 
-       TRACE_STATE("set CONNECTION_CLOSE on quic-conn", QMUX_EV_QCC_WAKE, qcc->conn);
+       TRACE_STATE("set CONNECTION_CLOSE on quic-conn", QMUX_EV_QCC_ERR, qcc->conn);
        quic_set_connection_close(qcc->conn->handle.qc, quic_err_transport(err));
        qcc->flags |= QC_CF_CC_EMIT;
        tasklet_wakeup(qcc->wait_event.tasklet);
@@ -2448,7 +2448,7 @@ static int qc_init(struct connection *conn, struct proxy *prx,
        HA_ATOMIC_STORE(&conn->handle.qc->qcc, qcc);
 
        if (qcc_install_app_ops(qcc, conn->handle.qc->app_ops)) {
-               TRACE_PROTO("Cannot install app layer", QMUX_EV_QCC_NEW, qcc->conn);
+               TRACE_PROTO("Cannot install app layer", QMUX_EV_QCC_NEW|QMUX_EV_QCC_ERR, qcc->conn);
                /* prepare a CONNECTION_CLOSE frame */
                quic_set_connection_close(conn->handle.qc, quic_err_transport(QC_ERR_APPLICATION_ERROR));
                goto fail_install_app_ops;