]> granicus.if.org Git - apache/commitdiff
prevent seg faults in mod_status trying to access vhost structures from
authorGreg Ames <gregames@apache.org>
Fri, 26 Oct 2001 15:40:04 +0000 (15:40 +0000)
committerGreg Ames <gregames@apache.org>
Fri, 26 Oct 2001 15:40:04 +0000 (15:40 +0000)
the former generation, after a restart.  It happens mostly when the MPM has
threads.

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

server/scoreboard.c

index e455d00209c1e817e8f981e9fd8c956a06b408f6..afc018be6cd4a1cb02242a5582de587252af3ec6 100644 (file)
@@ -277,7 +277,7 @@ AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid)
 
 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 @@ AP_DECLARE(int) ap_update_child_status(int child_num, int thread_num, int status
     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) {