]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: muxes: Improve show_fd callbacks to dump endpoint flags
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 10:08:09 +0000 (12:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:16 +0000 (15:10 +0200)
H1, H2 and FCGI multiplexers define a show_fd callback to dump some internal
info. The stream endpoint and its flags are now dumped if it exists.

src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c

index 33b69a2e294d6d780965f0ef298684a3c176d23c..56a9a0bd012ee0b64cee414ed417ddd809d78760 100644 (file)
@@ -4189,9 +4189,12 @@ static int fcgi_show_fd(struct buffer *msg, struct connection *conn)
                              (unsigned int)b_data(&fstrm->rxbuf), b_orig(&fstrm->rxbuf),
                              (unsigned int)b_head_ofs(&fstrm->rxbuf), (unsigned int)b_size(&fstrm->rxbuf),
                              fstrm->cs);
-               if (fstrm->cs)
-                       chunk_appendf(msg, " .cs.flg=0x%08x .cs.app=%p",
-                                     fstrm->cs->flags, fstrm->cs->app);
+               if (fstrm->endp) {
+                       chunk_appendf(msg, " .endp.flg=0x%08x", fstrm->endp->flags);
+                       if (!(fstrm->endp->flags & CS_EP_ORPHAN))
+                               chunk_appendf(msg, " .cs.flg=0x%08x .cs.app=%p",
+                                             fstrm->cs->flags, fstrm->cs->app);
+               }
                chunk_appendf(&trash, " .subs=%p", fstrm->subs);
                if (fstrm->subs) {
                        chunk_appendf(&trash, "(ev=%d tl=%p", fstrm->subs->events, fstrm->subs->tasklet);
index 6bfb69bc2ca2c2e5acdc30dc73f9b1972903561c..851967edc7b120b291d1eb7cc9890d2fd42fa7f8 100644 (file)
@@ -3889,15 +3889,17 @@ static int h1_show_fd(struct buffer *msg, struct connection *conn)
                        method = http_known_methods[h1s->meth].ptr;
                else
                        method = "UNKNOWN";
-               chunk_appendf(msg, " h1s=%p h1s.flg=0x%x .req.state=%s .res.state=%s"
+               chunk_appendf(msg, " h1s=%p h1s.flg=0x%x .endp.flg=0x%x .req.state=%s .res.state=%s"
                    " .meth=%s status=%d",
-                             h1s, h1s->flags,
+                             h1s, h1s->flags, h1s->endp->flags,
                              h1m_state_str(h1s->req.state),
                              h1m_state_str(h1s->res.state), method, h1s->status);
-               if (h1s->cs)
-                       chunk_appendf(msg, " .cs.flg=0x%08x .cs.app=%p",
-                                     h1s->cs->flags, h1s->cs->app);
-
+               if (h1s->endp) {
+                       chunk_appendf(msg, " .endp.flg=0x%08x", h1s->endp->flags);
+                       if (!(h1s->endp->flags & CS_EP_ORPHAN))
+                               chunk_appendf(msg, " .cs.flg=0x%08x .cs.app=%p",
+                                             h1s->cs->flags, h1s->cs->app);
+               }
                chunk_appendf(&trash, " .subs=%p", h1s->subs);
                if (h1s->subs) {
                        chunk_appendf(&trash, "(ev=%d tl=%p", h1s->subs->events, h1s->subs->tasklet);
index 71327b86b30a78ee9b71ae36e2e0af5ac865c757..3b321d5e2c7e9d1e51468e8ca2cf02396d0af5f0 100644 (file)
@@ -6744,6 +6744,11 @@ static int h2_show_fd(struct buffer *msg, struct connection *conn)
                        chunk_appendf(msg, "(.flg=0x%08x .app=%p)",
                                      h2s->cs->flags, h2s->cs->app);
 
+               chunk_appendf(msg, "endp=%p", h2s->endp);
+               if (h2s->endp)
+                       chunk_appendf(msg, "(.flg=0x%08x)",
+                                     h2s->endp->flags);
+
                chunk_appendf(&trash, " .subs=%p", h2s->subs);
                if (h2s->subs) {
                        chunk_appendf(&trash, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);