]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: prepare traces support for QMux
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 26 Mar 2026 14:03:04 +0000 (15:03 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Apr 2026 12:02:04 +0000 (14:02 +0200)
Ensure mux-quic traces will be compatible with the new QMux protocol.
This is necessary as the quic_conn element is accessed to display some
transport information. Use conn_is_quic() to protect these accesses.

src/qmux_trace.c

index 58cd45d2879909826cc398ef43d9ce048dd102c7..b5d85e2eac88c270a992a3beb4acbe7040f9f567 100644 (file)
@@ -143,18 +143,19 @@ static char *qcc_app_st_to_str(const enum qcc_app_st st)
 
 void qmux_dump_qcc_info(struct buffer *msg, const struct qcc *qcc)
 {
-       const struct quic_conn *qc = qcc->conn->handle.qc;
+       const struct quic_conn *qc = conn_is_quic(qcc->conn) ? qcc->conn->handle.qc : NULL;
 
        chunk_appendf(msg, " qcc=%p(%c)", qcc, (qcc->flags & QC_CF_IS_BACK) ? 'B' : 'F');
-       if (qcc->conn->handle.qc)
+       if (qc)
                chunk_appendf(msg, " qc=%p", qcc->conn->handle.qc);
        chunk_appendf(msg, " .st=%s .sc=%llu .hreq=%llu .flg=0x%04x",
                      qcc_app_st_to_str(qcc->app_st), (ullong)qcc->nb_sc,
                      (ullong)qcc->nb_hreq, qcc->flags);
 
-       chunk_appendf(msg, " .tx=%llu %llu/%llu bwnd=%llu/%llu",
-                     (ullong)qcc->tx.fc.off_soft, (ullong)qcc->tx.fc.off_real, (ullong)qcc->tx.fc.limit,
-                     (ullong)qcc->tx.buf_in_flight, (ullong)qc->path->cwnd);
+       chunk_appendf(msg, " .tx=%llu %llu/%llu",
+                     (ullong)qcc->tx.fc.off_soft, (ullong)qcc->tx.fc.off_real, (ullong)qcc->tx.fc.limit);
+       if (qc)
+               chunk_appendf(msg, " bwnd=%llu/%llu", (ullong)qcc->tx.buf_in_flight, (ullong)qc->path->cwnd);
 }
 
 void qmux_dump_qcs_info(struct buffer *msg, const struct qcs *qcs)