]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: cli/proxy: don't try to dump idle connection state if there's none
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Jul 2020 13:19:57 +0000 (15:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Jul 2020 13:19:57 +0000 (15:19 +0200)
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.

src/proxy.c

index 93c46651cfce732f71d66d363984a830107b2678..a475095428c6a2b09e90050094711175fa26d03d 100644 (file)
@@ -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");