]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: trace/quic: make "qconn" selectable as a lockon criterion
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Aug 2024 13:21:00 +0000 (15:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Aug 2024 14:02:59 +0000 (16:02 +0200)
The test was was performed but there's no way to set the option! Let's
just add "qconn" to select the quic conn when the source supports it.

This can be backported at least to 3.0, probably 2.6.

src/trace.c

index 2d1257c9762fe4522234ace9c5d4acc5b24398eb..b8a1397723468e14bb11149c5239c097dda88f45 100644 (file)
@@ -649,7 +649,11 @@ static int trace_parse_statement(char **args, char **msg)
                        if (src->arg_def & (TRC_ARGS_CONN|TRC_ARGS_STRM))
                                chunk_appendf(&trash, "  %c server     : lock on the server that started the trace\n",
                                              src->lockon == TRACE_LOCKON_SERVER ? '*' : ' ');
-
+#ifdef USE_QUIC
+                       if (src->arg_def & TRC_ARGS_QCON)
+                               chunk_appendf(&trash, "  %c qconn      : lock on the QUIC connection that started the trace\n",
+                                             src->lockon == TRACE_LOCKON_QCON ? '*' : ' ');
+#endif
                        if (src->arg_def & (TRC_ARGS_CONN|TRC_ARGS_QCON|TRC_ARGS_SESS|TRC_ARGS_STRM))
                                chunk_appendf(&trash, "  %c session    : lock on the session that started the trace\n",
                                              src->lockon == TRACE_LOCKON_SESSION ? '*' : ' ');
@@ -721,6 +725,10 @@ static int trace_parse_statement(char **args, char **msg)
                        HA_ATOMIC_STORE(&src->lockon, TRACE_LOCKON_SESSION);
                        HA_ATOMIC_STORE(&src->lockon_ptr, NULL);
                }
+               else if ((src->arg_def & TRC_ARGS_QCON) && strcmp(name, "qconn") == 0) {
+                       HA_ATOMIC_STORE(&src->lockon, TRACE_LOCKON_QCON);
+                       HA_ATOMIC_STORE(&src->lockon_ptr, NULL);
+               }
                else if ((src->arg_def & TRC_ARGS_STRM) && strcmp(name, "stream") == 0) {
                        HA_ATOMIC_STORE(&src->lockon, TRACE_LOCKON_STREAM);
                        HA_ATOMIC_STORE(&src->lockon_ptr, NULL);