]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: add quic_conn instance in traces for qc_new_conn
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 Dec 2021 13:51:56 +0000 (14:51 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 Dec 2021 14:53:19 +0000 (15:53 +0100)
The connection instance has been replaced by a quic_conn as first
argument to QUIC traces. It is possible to report the quic_conn instance
in the qc_new_conn(), contrary to the connection which is not
initialized at this stage.

src/xprt_quic.c

index 1d1f259d58d44ef6a047a42de3caac7d7aa13c0c..ee609753f2d702ecd926e8a830f9c817aa79b108 100644 (file)
@@ -3327,7 +3327,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
 
        buf_area = pool_alloc(pool_head_quic_conn_rxbuf);
        if (!buf_area) {
-               TRACE_PROTO("Could not allocate a new RX buffer", QUIC_EV_CONN_INIT);
+               TRACE_PROTO("Could not allocate a new RX buffer", QUIC_EV_CONN_INIT, qc);
                goto err;
        }
 
@@ -3362,7 +3362,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
 
        icid = new_quic_cid(&qc->cids, qc, 0);
        if (!icid) {
-               TRACE_PROTO("Could not allocate a new connection ID", QUIC_EV_CONN_INIT);
+               TRACE_PROTO("Could not allocate a new connection ID", QUIC_EV_CONN_INIT, qc);
                goto err;
        }
 
@@ -3382,7 +3382,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
        /* QUIC encryption level context initialization. */
        for (i = 0; i < QUIC_TLS_ENC_LEVEL_MAX; i++) {
                if (!quic_conn_enc_level_init(qc, i)) {
-                       TRACE_PROTO("Could not initialize an encryption level", QUIC_EV_CONN_INIT);
+                       TRACE_PROTO("Could not initialize an encryption level", QUIC_EV_CONN_INIT, qc);
                        goto err;
                }
                /* Initialize the packet number space. */
@@ -3406,7 +3406,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
        HA_RWLOCK_INIT(&qc->rx.buf_rwlock);
        LIST_INIT(&qc->rx.pkt_list);
        if (!quic_tls_ku_init(qc)) {
-               TRACE_PROTO("Key update initialization failed", QUIC_EV_CONN_INIT);
+               TRACE_PROTO("Key update initialization failed", QUIC_EV_CONN_INIT, qc);
                goto err;
        }
 
@@ -3414,12 +3414,12 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
        qc->path = &qc->paths[0];
        quic_path_init(qc->path, ipv4, default_quic_cc_algo, qc);
 
-       TRACE_LEAVE(QUIC_EV_CONN_INIT);
+       TRACE_LEAVE(QUIC_EV_CONN_INIT, qc);
 
        return qc;
 
  err:
-       TRACE_DEVEL("leaving in error", QUIC_EV_CONN_INIT);
+       TRACE_DEVEL("leaving in error", QUIC_EV_CONN_INIT, qc ? qc : NULL);
        quic_conn_free(qc);
        return NULL;
 }