From 7f17e1292a10c8e571818e2f2dbbe76261e1a72d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Feb 2001 18:41:44 +0000 Subject: [PATCH] Fix a problem displaying status when a threaded MPM is used. 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 18ae03f3ae..3cd30fe54b 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -469,20 +469,20 @@ static int status_handler(request_rec *r) ap_rputs("\".\" Open slot with no current process

\n", r); ap_rputs("

\n", r); if (!ap_extended_status) { - int j = 0; - int k; + int j; + int k = 0; ap_rputs("PID Key:
\n", r); ap_rputs("

\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);
 		    }
-- 
2.50.1