]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: add the expire task and its expiration date in "show fd"
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Nov 2022 13:49:56 +0000 (14:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Nov 2022 13:49:56 +0000 (14:49 +0100)
Just like for the H2 multiplexer, info about the H1 connection task is now
displayed in "show fd" output. The task pointer is displayed and, if not
null, its expiration date.

It may be useful to backport it.

src/mux_h1.c

index 9a2306ae64f793ae49babbe368c1d251090d559d..a8421b76ca00a5710505b64c0b95426145bb7a6e 100644 (file)
@@ -3907,6 +3907,14 @@ static int h1_dump_h1c_info(struct buffer *msg, struct h1c *h1c, const char *pfx
                      (unsigned int)b_head_ofs(&h1c->ibuf), (unsigned int)b_size(&h1c->ibuf),
                      (unsigned int)b_data(&h1c->obuf), b_orig(&h1c->obuf),
                      (unsigned int)b_head_ofs(&h1c->obuf), (unsigned int)b_size(&h1c->obuf));
+
+       chunk_appendf(msg, " .task=%p", h1c->task);
+       if (h1c->task) {
+               chunk_appendf(msg, " .exp=%s",
+                             h1c->task->expire ? tick_is_expired(h1c->task->expire, now_ms) ? "<PAST>" :
+                             human_time(TICKS_TO_MS(h1c->task->expire - now_ms), TICKS_TO_MS(1000)) : "<NEVER>");
+       }
+
        return ret;
 }