Commit 33fef471 authored by Greg Ames's avatar Greg Ames
Browse files

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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91667 13f79535-47bb-0310-9956-ffa450edef68
parent 24af68d9
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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;
        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;
        ws->vhostrec = NULL;
        }
    }

    if (ap_extended_status) {