]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream/htx: Add info about the HTX structs in "show sess all" command
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Jan 2019 13:30:44 +0000 (14:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Jan 2019 14:21:03 +0000 (15:21 +0100)
For HTX streams, info about the HTX structure is now dumped for the request and
the response channels in "show sess all" command.

The patch may be backported to 1.9.

src/stream.c

index ac323b1e75f1971d4adeafbd8b854dd7c54859fb..8bf0917f8e3ee472ed8a368787b16585aa7bd8cd 100644 (file)
@@ -3087,6 +3087,16 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                             strm->txn ? strm->txn->req.next : 0, (unsigned int)ci_data(&strm->req),
                             (unsigned int)strm->req.buf.size);
 
+               if (IS_HTX_STRM(strm)) {
+                       struct htx *htx = htxbuf(&strm->req.buf);
+
+                       chunk_appendf(&trash,
+                                     "      htx=%p size=%u data=%u used=%u wrap=%s extra=%llu\n",
+                                     htx, htx->size, htx->data, htx->used,
+                                     (!htx->used || htx->tail+1 == htx->wrap) ? "NO" : "YES",
+                                     (unsigned long long)htx->extra);
+               }
+
                chunk_appendf(&trash,
                             "  res=%p (f=0x%06x an=0x%x pipe=%d tofwd=%d total=%lld)\n"
                             "      an_exp=%s",
@@ -3116,6 +3126,16 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                             strm->txn ? strm->txn->rsp.next : 0, (unsigned int)ci_data(&strm->res),
                             (unsigned int)strm->res.buf.size);
 
+               if (IS_HTX_STRM(strm)) {
+                       struct htx *htx = htxbuf(&strm->res.buf);
+
+                       chunk_appendf(&trash,
+                                     "      htx=%p flags=0x%x size=%u data=%u used=%u wrap=%s extra=%llu\n",
+                                     htx, htx->flags, htx->size, htx->data, htx->used,
+                                     (!htx->used || htx->tail+1 == htx->wrap) ? "NO" : "YES",
+                                     (unsigned long long)htx->extra);
+               }
+
                if (ci_putchk(si_ic(si), &trash) == -1) {
                        si_rx_room_blk(si);
                        return 0;