]> granicus.if.org Git - apache/commitdiff
fix pid numbers in mod_status output when using a threaded mpm. pid_buffer was
authorGreg Ames <gregames@apache.org>
Tue, 10 Jul 2001 22:50:54 +0000 (22:50 +0000)
committerGreg Ames <gregames@apache.org>
Tue, 10 Jul 2001 22:50:54 +0000 (22:50 +0000)
being indexed by worker slot during initialization, then by process slot when
generating output.

This saves a little storage and a few cycles, too.

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

modules/generators/mod_status.c

index e00cffc41e77d171bc53e7de35c85b7a617bef45..42843fc6998e7231431281506440f9a0d722b4a8 100644 (file)
@@ -254,7 +254,7 @@ static int status_handler(request_rec *r)
     worker_score ws_record;
     process_score ps_record;
     char stat_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
-    pid_t pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
+    pid_t pid_buffer[HARD_SERVER_LIMIT];
     clock_t tu, ts, tcu, tcs;
     server_rec *vhost;
 
@@ -321,7 +321,6 @@ static int status_handler(request_rec *r)
            ps_record = ap_scoreboard_image->parent[i];
            res = ws_record.status;
            stat_buffer[indx] = status_flags[res];
-           pid_buffer[indx] = ps_record.pid;
            if (res == SERVER_READY)
                ready++;
            else if (res != SERVER_DEAD && res != SERVER_IDLE_KILL)
@@ -345,6 +344,7 @@ static int status_handler(request_rec *r)
                }
            }
         }
+       pid_buffer[i] = ps_record.pid;
     }
 
     /* up_time in seconds */