]> granicus.if.org Git - apache/commitdiff
Fix a problem displaying status when a threaded MPM is used.
authorJeff Trawick <trawick@apache.org>
Wed, 28 Feb 2001 18:41:44 +0000 (18:41 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 28 Feb 2001 18:41:44 +0000 (18:41 +0000)
The line

   int indx = (i * HARD_THREAD_LIMIT) + j;

in the vicinity of the change was bad; k needed to be added
instead of j.

I swapped the use of j and k in this section so that i and j
had the same meaning as in an earlier nested loop.  I suspect
that the difference in meaning is what led to the bug.

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

modules/generators/mod_status.c

index 18ae03f3ae9738d20ebdb50037fed146896b60db..3cd30fe54b4be3c431f8916cb9123183adb2852b 100644 (file)
@@ -469,20 +469,20 @@ static int status_handler(request_rec *r)
        ap_rputs("\"<B><code>.</code></B>\" Open slot with no current process<P>\n", r);
        ap_rputs("<P>\n", r);
        if (!ap_extended_status) {
-           int j = 0;
-            int k;
+           int j;
+            int k = 0;
            ap_rputs("PID Key: <br>\n", r);
            ap_rputs("<PRE>\n", r);
            for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
-                for (k = 0; k < HARD_THREAD_LIMIT; ++k) {
+                for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
                     int indx = (i * HARD_THREAD_LIMIT) + j;
 
                    if (stat_buffer[indx] != '.') {
                        ap_rprintf(r, "   %d in state: %c ", pid_buffer[i],
                        stat_buffer[indx]);
-                       if (++j >= 3) {
+                       if (++k >= 3) {
                            ap_rputs("\n", r);
-                           j = 0;
+                           k = 0;
                        } else
                            ap_rputs(",", r);
                    }