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.
This commit is contained in:
Willy Tarreau 2020-07-02 15:19:57 +02:00
parent 48ce6a3ab1
commit 42abe68f11

View 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");