]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
set extra=0 only when min=max. Fixes #4163
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 13:53:45 +0000 (09:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 13:53:45 +0000 (09:53 -0400)
src/lib/server/pool.c

index ef7de91b59cd8ee87a688720f2748e75a5338c3d..bb93a3b131a63f11a3aec65b7a13f75e69f00cc6 100644 (file)
@@ -677,11 +677,12 @@ static int connection_check(fr_pool_t *pool, request_t *request)
 
        /*
         *      But if we're already at "min", then don't spawn more,
-        *      and we don't have any extra idle connections.
+        *      and set extra to zero if there's no possibility for extra.
         */
        } else if ((pool->state.num + pool->state.pending) >= pool->min) {
                spawn = 0;
-               extra = 0;
+
+               if (pool->min == pool->max) extra = 0;
 
        /*
         *      If we're about to create more than "max",