From: Willy Tarreau Date: Sun, 26 May 2019 09:32:27 +0000 (+0200) Subject: MINOR: mux-h2: report the mbuf's head and tail in "show fd" X-Git-Tag: v2.0-dev5~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60f62682b1efc4483f86525a63b8af3cc84f87ef;p=thirdparty%2Fhaproxy.git MINOR: mux-h2: report the mbuf's head and tail in "show fd" It's useful to know how the mbuf spans over the whole area and to have access to the first and last ones, so let's dump just this. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 1d64d261eb..e727549176 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5620,7 +5620,7 @@ static void h2_show_fd(struct buffer *msg, struct connection *conn) int send_cnt = 0; int tree_cnt = 0; int orph_cnt = 0; - struct buffer *tmbuf; + struct buffer *hmbuf, *tmbuf; if (!h2c) return; @@ -5641,16 +5641,21 @@ static void h2_show_fd(struct buffer *msg, struct connection *conn) node = eb32_next(node); } + hmbuf = br_head(h2c->mbuf); tmbuf = br_tail(h2c->mbuf); chunk_appendf(msg, " h2c.st0=%d .err=%d .maxid=%d .lastid=%d .flg=0x%04x" " .nbst=%u .nbcs=%u .fctl_cnt=%d .send_cnt=%d .tree_cnt=%d" - " .orph_cnt=%d .sub=%d .dsi=%d .dbuf=%u@%p+%u/%u .msi=%d .mbuf=%u@%p+%u/%u", + " .orph_cnt=%d .sub=%d .dsi=%d .dbuf=%u@%p+%u/%u .msi=%d" + " .mbuf=[%u..%u|%u],h=[%u@%p+%u/%u],t=[%u@%p+%u/%u]", h2c->st0, h2c->errcode, h2c->max_id, h2c->last_sid, h2c->flags, h2c->nb_streams, h2c->nb_cs, fctl_cnt, send_cnt, tree_cnt, orph_cnt, h2c->wait_event.events, h2c->dsi, (unsigned int)b_data(&h2c->dbuf), b_orig(&h2c->dbuf), (unsigned int)b_head_ofs(&h2c->dbuf), (unsigned int)b_size(&h2c->dbuf), h2c->msi, + br_head_idx(h2c->mbuf), br_tail_idx(h2c->mbuf), br_size(h2c->mbuf), + (unsigned int)b_data(hmbuf), b_orig(hmbuf), + (unsigned int)b_head_ofs(hmbuf), (unsigned int)b_size(hmbuf), (unsigned int)b_data(tmbuf), b_orig(tmbuf), (unsigned int)b_head_ofs(tmbuf), (unsigned int)b_size(tmbuf));