]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: add traces on sd attach
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 31 Dec 2024 14:18:52 +0000 (15:18 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Jan 2025 10:25:40 +0000 (11:25 +0100)
Add traces into qcs_attach_sc(). This function is called when a request
is received on a QCS stream and a streamdesc instance is attached. This
will be useful to facilitate debugging.

src/mux_quic.c

index 98b3af41ddeb8d7a84360027a865149aa834a273..1394a365933e2bdad94e802f1eb80ad4ec16f0fd 100644 (file)
@@ -894,17 +894,27 @@ void qcs_send_metadata(struct qcs *qcs)
        qc_stream_desc_sub_room(qcs->stream, NULL);
 }
 
+/* Instantiate a streamdesc instance for <qcs> stream. This is necessary to
+ * transfer data after a new request reception. <buf> can be used to forward
+ * the first received request data. <fin> must be set if the whole request is
+ * already received.
+ *
+ * Returns the newly allocated instance on success or NULL on error.
+ */
 struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin)
 {
        struct qcc *qcc = qcs->qcc;
        struct session *sess = qcc->conn->owner;
 
+       TRACE_ENTER(QMUX_EV_STRM_RECV, qcc->conn, qcs);
 
        /* TODO duplicated from mux_h2 */
        sess->t_idle = ns_to_ms(now_ns - sess->accept_ts) - sess->t_handshake;
 
-       if (!sc_new_from_endp(qcs->sd, sess, buf))
+       if (!sc_new_from_endp(qcs->sd, sess, buf)) {
+               TRACE_DEVEL("leaving on error", QMUX_EV_STRM_RECV, qcc->conn, qcs);
                return NULL;
+       }
 
        /* QC_SF_HREQ_RECV must be set once for a stream. Else, nb_hreq counter
         * will be incorrect for the connection.
@@ -948,6 +958,7 @@ struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin)
                se_fl_set_error(qcs->sd);
        }
 
+       TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs);
        return qcs->sd->sc;
 }