]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: trace/quic: enable conn/session pointer recovery from quic_conn
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Aug 2024 09:07:13 +0000 (11:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Aug 2024 14:02:59 +0000 (16:02 +0200)
In __trace_enabled(), a quic_conn was detected, but it was not possible
to derive the connection nor the session from it, which was quite limiting
in terms of ability to track a same instance.

This should be backported to at least 3.0, maybe even 2.6.

src/trace.c

index fcf557bb7b31cad79d2fcbc88c50aa96bdd5902b..bed9d799b2a0732527009eeb4099de0d0c2bcd83 100644 (file)
@@ -27,6 +27,7 @@
 #include <haproxy/istbuf.h>
 #include <haproxy/list.h>
 #include <haproxy/log.h>
+#include <haproxy/quic_conn-t.h>
 #include <haproxy/sink.h>
 #include <haproxy/trace.h>
 
@@ -127,6 +128,10 @@ int __trace_enabled(enum trace_level level, uint64_t mask, struct trace_source *
        if (src->arg_def & TRC_ARGS_APPCTX)
                appctx = trace_pick_arg(src->arg_def & TRC_ARGS_APPCTX, a1, a2, a3, a4);
 
+#ifdef USE_QUIC
+       if (qc && !conn)
+               conn = qc->conn;
+#endif
        if (!sess && strm)
                sess = strm->sess;
        else if (!sess && conn && LIST_INLIST(&conn->sess_el))