CLEANUP: muxes: Remove useless if condition in show_fd function
In H1, H2 and FCGI muxes, in the show_fd function, there is duplicated test on
the stream's subs field.
This patch fixes the issue #1142. It may be backported as far as 2.2.
(cherry picked from commit 6c93c4ef089fc79ce4e85fa0d9e7f61720291dba)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 9efb96c..a8528e8 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -4104,14 +4104,12 @@
fstrm->cs->flags, fstrm->cs->data);
chunk_appendf(&trash, " .subs=%p", fstrm->subs);
if (fstrm->subs) {
- if (fstrm->subs) {
- chunk_appendf(&trash, "(ev=%d tl=%p", fstrm->subs->events, fstrm->subs->tasklet);
- chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
- fstrm->subs->tasklet->calls,
- fstrm->subs->tasklet->context);
- resolve_sym_name(&trash, NULL, fstrm->subs->tasklet->process);
- chunk_appendf(&trash, ")");
- }
+ chunk_appendf(&trash, "(ev=%d tl=%p", fstrm->subs->events, fstrm->subs->tasklet);
+ chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
+ fstrm->subs->tasklet->calls,
+ fstrm->subs->tasklet->context);
+ resolve_sym_name(&trash, NULL, fstrm->subs->tasklet->process);
+ chunk_appendf(&trash, ")");
}
}
return 0;
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 7b7c83a..62f555e 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -2941,16 +2941,14 @@
chunk_appendf(&trash, " .subs=%p", h1s->subs);
if (h1s->subs) {
- if (h1s->subs) {
- chunk_appendf(&trash, "(ev=%d tl=%p", h1s->subs->events, h1s->subs->tasklet);
- chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
- h1s->subs->tasklet->calls,
- h1s->subs->tasklet->context);
- if (h1s->subs->tasklet->calls >= 1000000)
- ret = 1;
- resolve_sym_name(&trash, NULL, h1s->subs->tasklet->process);
- chunk_appendf(&trash, ")");
- }
+ chunk_appendf(&trash, "(ev=%d tl=%p", h1s->subs->events, h1s->subs->tasklet);
+ chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
+ h1s->subs->tasklet->calls,
+ h1s->subs->tasklet->context);
+ if (h1s->subs->tasklet->calls >= 1000000)
+ ret = 1;
+ resolve_sym_name(&trash, NULL, h1s->subs->tasklet->process);
+ chunk_appendf(&trash, ")");
}
}
return ret;
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 5458c1b..f820ec3 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -6260,16 +6260,14 @@
chunk_appendf(&trash, " .subs=%p", h2s->subs);
if (h2s->subs) {
- if (h2s->subs) {
- chunk_appendf(&trash, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);
- chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
- h2s->subs->tasklet->calls,
- h2s->subs->tasklet->context);
- if (h2s->subs->tasklet->calls >= 1000000)
- ret = 1;
- resolve_sym_name(&trash, NULL, h2s->subs->tasklet->process);
- chunk_appendf(&trash, ")");
- }
+ chunk_appendf(&trash, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);
+ chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
+ h2s->subs->tasklet->calls,
+ h2s->subs->tasklet->context);
+ if (h2s->subs->tasklet->calls >= 1000000)
+ ret = 1;
+ resolve_sym_name(&trash, NULL, h2s->subs->tasklet->process);
+ chunk_appendf(&trash, ")");
}
}
return ret;