]> granicus.if.org Git - apache/commitdiff
Fix a bug in setting max_daemons_limit that could lead to not noticing
authorManoj Kasichainula <manoj@apache.org>
Fri, 27 Aug 1999 21:22:28 +0000 (21:22 +0000)
committerManoj Kasichainula <manoj@apache.org>
Fri, 27 Aug 1999 21:22:28 +0000 (21:22 +0000)
that a child has died in some cases.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83817 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/dexter/dexter.c

index 48bf6b600b04c4fe24fc7ac49f477464debd3309..b7069171427c113c8201d1b4bb202d4da525081a 100644 (file)
@@ -100,6 +100,9 @@ static struct pollfd *listenfds;
  * The max child slot ever assigned, preserved across restarts.  Necessary
  * to deal with NumServers changes across SIGWINCH restarts.  We use this
  * value to optimize routines that have to scan the entire scoreboard.
+ *
+ * XXX - It might not be worth keeping this code in. There aren't very
+ * many child processes in this MPM.
  */
 int max_daemons_limit = -1;
 
@@ -1141,13 +1144,15 @@ static void perform_child_maintenance(void)
         unsigned char status = ap_scoreboard_image[i].status;
 
         if (status == SERVER_DEAD) {
-            free_slots[free_length] = i;
-            ++free_length;
+            if (free_length < spawn_rate) {
+                free_slots[free_length] = i;
+                ++free_length;
+            }
         } else {
             last_non_dead = i;
         }
 
-       if (free_length >= spawn_rate) {
+       if (i >= max_daemons_limit && free_length >= spawn_rate) {
            break;
        }
     }