BUG/MINOR: srv: do not cleanup idle conns if pool max is null

If a server is configured to not have any idle conns, returns immediatly
from srv_cleanup_connections. This avoids a segfault when a server is
configured with pool-max-conn to 0.

This should be backported up to 2.2.
This commit is contained in:
Amaury Denoyelle 2021-01-06 14:28:51 +01:00 committed by Christopher Faulet
parent e3c4192962
commit 10d5c3172b

View File

@ -5299,6 +5299,10 @@ static void srv_cleanup_connections(struct server *srv)
int did_remove;
int i;
/* nothing to do if pool-max-conn is null */
if (!srv->max_idle_conns)
return;
/* check all threads starting with ours */
for (i = tid;;) {
did_remove = 0;