]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
formatting, and make it more consistent
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 10:59:49 +0000 (06:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 11:28:52 +0000 (07:28 -0400)
src/lib/server/pool.c

index a953d1803ee96c00fb80fa006dea20a8865e2676..c828724b2feb0b509e6a3c5fb445ad208278d9c7 100644 (file)
@@ -675,6 +675,14 @@ static int connection_check(fr_pool_t *pool, request_t *request)
 
                ROPTIONAL(RINFO, INFO, "Need %i more connections to reach min connections (%i)", spawn, pool->min);
 
+       /*
+        *      But if we're already at "min", then don't spawn more,
+        *      and we don't have any extra idle connections.
+        */
+       } else if ((pool->num + pool->pending) >= pool->min) {
+               spawn = 0;
+               extra = 0;
+
        /*
         *      If we're about to create more than "max",
         *      don't create more.
@@ -686,13 +694,7 @@ static int connection_check(fr_pool_t *pool, request_t *request)
                 *      delete all of them.
                 */
                spawn = 0;
-               /*
-                *      But if the pool size is already "min", we
-                *      don't delete them.
-                */
-               if ((pool->state.num + pool->state.pending) == pool->min) {
-                       extra = 0;
-               }
+
                /* Otherwise, leave extra alone from above */
 
        /*