From 186367f4991305bb45d5faa3c2c296074abecdf9 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 30 May 2022 08:45:15 +0200 Subject: [PATCH] CLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions In muxes, the stream-endoint descriptor of a stream is always defined. Thus, in .show_fd callback functions, there is no reason to test it. This patch should address the issue #1727. . --- src/mux_fcgi.c | 12 ++++++------ src/mux_h1.c | 13 ++++++------- src/mux_h2.c | 4 +--- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index c93f7c863..26240cf94 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -4192,12 +4192,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), fcgi_strm_sc(fstrm)); - if (fstrm->sd) { - chunk_appendf(msg, " .sd.flg=0x%08x", se_fl_get(fstrm->sd)); - if (!se_fl_test(fstrm->sd, SE_FL_ORPHAN)) - chunk_appendf(msg, " .sc.flg=0x%08x .sc.app=%p", - fcgi_strm_sc(fstrm)->flags, fcgi_strm_sc(fstrm)->app); - } + + chunk_appendf(msg, " .sd.flg=0x%08x", se_fl_get(fstrm->sd)); + if (!se_fl_test(fstrm->sd, SE_FL_ORPHAN)) + chunk_appendf(msg, " .sc.flg=0x%08x .sc.app=%p", + fcgi_strm_sc(fstrm)->flags, fcgi_strm_sc(fstrm)->app); + chunk_appendf(&trash, " .subs=%p", fstrm->subs); if (fstrm->subs) { chunk_appendf(&trash, "(ev=%d tl=%p", fstrm->subs->events, fstrm->subs->tasklet); diff --git a/src/mux_h1.c b/src/mux_h1.c index a7ebf1148..929867b00 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3914,13 +3914,12 @@ static int h1_show_fd(struct buffer *msg, struct connection *conn) h1s, h1s->flags, se_fl_get(h1s->sd), h1m_state_str(h1s->req.state), h1m_state_str(h1s->res.state), method, h1s->status); - if (h1s->sd) { - chunk_appendf(msg, " .sd.flg=0x%08x", - se_fl_get(h1s->sd)); - if (!se_fl_test(h1s->sd, SE_FL_ORPHAN)) - chunk_appendf(msg, " .sc.flg=0x%08x .sc.app=%p", - h1s_sc(h1s)->flags, h1s_sc(h1s)->app); - } + + chunk_appendf(msg, " .sd.flg=0x%08x", se_fl_get(h1s->sd)); + if (!se_fl_test(h1s->sd, SE_FL_ORPHAN)) + chunk_appendf(msg, " .sc.flg=0x%08x .sc.app=%p", + h1s_sc(h1s)->flags, h1s_sc(h1s)->app); + chunk_appendf(&trash, " .subs=%p", h1s->subs); if (h1s->subs) { chunk_appendf(&trash, "(ev=%d tl=%p", h1s->subs->events, h1s->subs->tasklet); diff --git a/src/mux_h2.c b/src/mux_h2.c index 20c646ffe..bdd47f555 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6767,9 +6767,7 @@ static int h2_show_fd(struct buffer *msg, struct connection *conn) h2s_sc(h2s)->flags, h2s_sc(h2s)->app); chunk_appendf(msg, "sd=%p", h2s->sd); - if (h2s->sd) - chunk_appendf(msg, "(.flg=0x%08x)", - se_fl_get(h2s->sd)); + chunk_appendf(msg, "(.flg=0x%08x)", se_fl_get(h2s->sd)); chunk_appendf(&trash, " .subs=%p", h2s->subs); if (h2s->subs) {