You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gr...@apache.org on 2001/10/26 17:40:04 UTC

cvs commit: httpd-2.0/server scoreboard.c

gregames    01/10/26 08:40:04

  Modified:    server   scoreboard.c
  Log:
  prevent seg faults in mod_status trying to access vhost structures from
  the former generation, after a restart.  It happens mostly when the MPM has
  threads.
  
  Revision  Changes    Path
  1.37      +7 -3      httpd-2.0/server/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- scoreboard.c	2001/08/30 15:44:13	1.36
  +++ scoreboard.c	2001/10/26 15:40:04	1.37
  @@ -277,7 +277,7 @@
   
   AP_DECLARE(int) ap_update_child_status(int child_num, int thread_num, int status, request_rec *r)
   {
  -    int old_status;
  +    int old_status, i;
       worker_score *ws;
       process_score *ps;
   
  @@ -293,8 +293,12 @@
       if (status == SERVER_READY
   	&& old_status == SERVER_STARTING) {
           ws->thread_num = child_num * HARD_SERVER_LIMIT + thread_num;
  -        ps->generation = ap_my_generation;
  -        ws->vhostrec = NULL;
  +        if (ps->generation != ap_my_generation) {
  +            for (i = 0; i < HARD_THREAD_LIMIT; i++) {
  +                ap_scoreboard_image->servers[child_num][i].vhostrec = NULL;
  +            }
  +            ps->generation = ap_my_generation;
  +        }
       }
   
       if (ap_extended_status) {