]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEV: stream: Fix conn-streams dump in full stream message
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 Apr 2022 08:35:22 +0000 (10:35 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Apr 2022 12:14:27 +0000 (14:14 +0200)
Since the recent changes about the conn-streams, the stream dump in "show
sess all" command is a bit mangled. front and back conn-stream are now
properly displayed (csf and csb). In addition, when there is no backend
endpoint, "APPCTX" was always reported. Now, "NONE" is reported in this
case.

It is 2.6-specific. No backport needed.

src/stream.c

index dd7eb7b90cf23c7c596f9e2b8bda1ee0ed2346a6..e428c0c266e7830682473f75427ac28cc916555c 100644 (file)
@@ -3308,9 +3308,9 @@ static int stats_dump_full_strm_to_buffer(struct conn_stream *cs, struct stream
                              strm->txn->req.flags, strm->txn->rsp.flags);
 
                csf = strm->csf;
-               chunk_appendf(&trash, "  cs=%p csf=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
+               chunk_appendf(&trash, "  csf=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
                              csf, csf->flags, cs_state_str(csf->state),
-                             (csf->endp->flags & CS_EP_T_MUX ? "CONN" : "APPCTX"),
+                             (csf->endp->flags & CS_EP_T_MUX ? "CONN" : (csf->endp->flags & CS_EP_T_APPLET ? "APPCTX" : "NONE")),
                              csf->endp->target, csf->endp->flags, csf->wait_event.events);
 
                if ((conn = cs_conn(csf)) != NULL) {
@@ -3347,9 +3347,9 @@ static int stats_dump_full_strm_to_buffer(struct conn_stream *cs, struct stream
                }
 
                csb = strm->csb;
-               chunk_appendf(&trash, "  cs=%p csb=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
+               chunk_appendf(&trash, "  csb=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
                              csb, csb->flags, cs_state_str(csb->state),
-                             (csb->endp->flags & CS_EP_T_MUX ? "CONN" : "APPCTX"),
+                             (csb->endp->flags & CS_EP_T_MUX ? "CONN" : (csb->endp->flags & CS_EP_T_APPLET ? "APPCTX" : "NONE")),
                              csb->endp->target, csb->endp->flags, csb->wait_event.events);
                if ((conn = cs_conn(csb)) != NULL) {
                        chunk_appendf(&trash,