httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: httpd-2.0/server scoreboard.c
Date Fri, 26 Oct 2001 15:40:04 GMT
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) {
  
  
  

Mime
View raw message