From: Manoj Kasichainula Date: Fri, 27 Aug 1999 21:22:28 +0000 (+0000) Subject: Fix a bug in setting max_daemons_limit that could lead to not noticing X-Git-Tag: 1.3.10~367 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c78db0349d90d1e6b02a4098e83fefe3edb88681;p=apache Fix a bug in setting max_daemons_limit that could lead to not noticing 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 --- diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 48bf6b600b..b706917142 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -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; } }