From: Willy Tarreau Date: Thu, 2 Jul 2020 13:19:57 +0000 (+0200) Subject: BUG/MEDIUM: cli/proxy: don't try to dump idle connection state if there's none X-Git-Tag: v2.2-dev12~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42abe68f111fac0849e4c811de5ef8e772efeb17;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cli/proxy: don't try to dump idle connection state if there's none Commit 69f591e3b ("MINOR: cli/proxy: add a new "show servers conn" command") added the ability to dump the idle connections state for a server, but we must not do this if idle connections were not allocated, which happens if the server is configured with pool-max-conn 0. This is 2.2, no backport is needed. --- diff --git a/src/proxy.c b/src/proxy.c index 93c46651cf..a475095428 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1823,7 +1823,7 @@ static int dump_servers_state(struct stream_interface *si) srv->curr_used_conns, srv->max_used_conns, srv->est_need_conns, srv->curr_idle_nb, srv->curr_safe_nb, (int)srv->max_idle_conns, srv->curr_idle_conns); - for (thr = 0; thr < global.nbthread; thr++) + for (thr = 0; thr < global.nbthread && srv->curr_idle_thr; thr++) chunk_appendf(&trash, " %u", srv->curr_idle_thr[thr]); chunk_appendf(&trash, "\n");