Commit 7246d9b0 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

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
parent 7e4383cd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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);
		    }