]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
formatting, so we don't have nested "else" when they're not needed
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 11:22:57 +0000 (07:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jul 2021 11:23:16 +0000 (07:23 -0400)
src/main/connection.c

index 436bea9405a8ba5e0d5a273fb3f0dc4f40eecae3..412efe1bb35c4ce67d0d158fd09d5b8080489e95 100644 (file)
@@ -675,6 +675,14 @@ static int fr_connection_pool_check(fr_connection_pool_t *pool)
 
                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.
@@ -687,14 +695,6 @@ static int fr_connection_pool_check(fr_connection_pool_t *pool)
                 */
                spawn = 0;
 
-               /*
-                *      But if the pool size is already "min", we
-                *      don't delete them.
-                */
-               if ((pool->num + pool->pending) >= pool->min) {
-                       extra = 0;
-               }
-
                /* Otherwise, leave extra alone from above */
 
        /*