From: Jim Jagielski Date: Tue, 6 Sep 2016 17:41:58 +0000 (+0000) Subject: Merge r1757010, r1757011 from trunk: X-Git-Tag: 2.4.24~260 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d84b43c8d5bc00831db632658de18c28b5a16b43;p=apache Merge r1757010, r1757011 from trunk: Delay some memory allocation in order to save 272 bytes in the 'request' memory pool if mod_status handler is triggered and is not able to handle the request Fix

tag closing syntax Submitted by: jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1759476 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 68fcf988fe..cc105772c9 100644 --- a/STATUS +++ b/STATUS @@ -117,13 +117,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_status: Delay some memory allocation - Fix

tag closing syntax - trunk patch: http://svn.apache.org/r1757010 - http://svn.apache.org/r1757011 - 2.4.x patch: trunk works - +1: jailletc36, jchampion, jim (will fix in 2.4) - jchampion: nitpick: r1757010 introduces trailing whitespace PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 4ff9df1988..70df1a100e 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -195,7 +195,7 @@ static int status_handler(request_rec *r) long req_time; int short_report; int no_table_report; - worker_score *ws_record = apr_palloc(r->pool, sizeof *ws_record); + worker_score *ws_record; process_score *ps_record; char *stat_buffer; pid_t *pid_buffer, worker_pid; @@ -293,6 +293,8 @@ static int status_handler(request_rec *r) } } + ws_record = apr_palloc(r->pool, sizeof *ws_record); + for (i = 0; i < server_limit; ++i) { #ifdef HAVE_TIMES clock_t proc_tu = 0, proc_ts = 0, proc_tcu = 0, proc_tcs = 0; @@ -621,7 +623,7 @@ static int status_handler(request_rec *r) "\"G\" Gracefully finishing,
\n" "\"I\" Idle cleanup of worker, \n" "\".\" Open slot with no current process
\n" - "

\n", r); + "

\n", r); if (!ap_extended_status) { int j; int k = 0;