manoj       99/08/27 14:22:30

  Modified:    src/modules/mpm/dexter dexter.c
  Log:
  Fix a bug in setting max_daemons_limit that could lead to not noticing
  that a child has died in some cases.
  
  Revision  Changes    Path
  1.28      +8 -3      apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -d -u -r1.27 -r1.28
  --- dexter.c  1999/08/17 22:04:54     1.27
  +++ dexter.c  1999/08/27 21:22:28     1.28
  @@ -100,6 +100,9 @@
    * 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 @@
           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;
        }
       }
  
  
  

Reply via email to