]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Slightly Improve H1 traces
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Nov 2021 09:30:15 +0000 (10:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Nov 2021 10:45:27 +0000 (11:45 +0100)
Connection and conn-stream pointers and flags are now dumped, if available,
in each trace messages. In addition, shutr and shutw mode is now reported.

src/mux_h1.c

index 63270e91495e685fc685f14d1596c8a2da2918a4..104b97f8f9d7c4949f179dd87a6addb670f95487 100644 (file)
@@ -325,8 +325,13 @@ static void h1_trace(enum trace_level level, uint64_t mask, const struct trace_s
 
        /* Display h1c info and, if defined, h1s info (pointer + flags) */
        chunk_appendf(&trace_buf, " - h1c=%p(0x%08x)", h1c, h1c->flags);
-       if (h1s)
+       if (h1c->conn)
+               chunk_appendf(&trace_buf, " conn=%p(0x%08x)", h1c->conn, h1c->conn->flags);
+       if (h1s) {
                chunk_appendf(&trace_buf, " h1s=%p(0x%08x)", h1s, h1s->flags);
+               if (h1s->cs)
+                       chunk_appendf(&trace_buf, " cs=%p(0x%08x)", h1s->cs, h1s->cs->flags);
+       }
 
        if (src->verbosity == H1_VERB_MINIMAL)
                return;
@@ -3245,7 +3250,7 @@ static void h1_shutr(struct conn_stream *cs, enum cs_shr_mode mode)
                return;
        h1c = h1s->h1c;
 
-       TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s);
+       TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 
        if (cs->flags & CS_FL_SHR)
                goto end;
@@ -3288,7 +3293,7 @@ static void h1_shutw(struct conn_stream *cs, enum cs_shw_mode mode)
                return;
        h1c = h1s->h1c;
 
-       TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s);
+       TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 
        if (cs->flags & CS_FL_SHW)
                goto end;