1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Skip a potentially heavyweight call to sysconf, plus some

local variable initializations, in the common case where the
request is not for the server status page


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94745 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brian Pane
2002-04-22 04:48:11 +00:00
parent f0cee8f8fb
commit 6b59ee40b9

View File

@@ -240,22 +240,18 @@ static int status_handler(request_rec *r)
apr_time_t nowtime; apr_time_t nowtime;
apr_interval_time_t up_time; apr_interval_time_t up_time;
int j, i, res; int j, i, res;
int ready = 0; int ready;
int busy = 0; int busy;
unsigned long count = 0; unsigned long count;
unsigned long lres, my_lres, conn_lres; unsigned long lres, my_lres, conn_lres;
apr_off_t bytes, my_bytes, conn_bytes; apr_off_t bytes, my_bytes, conn_bytes;
apr_off_t bcount = 0, kbcount = 0; apr_off_t bcount, kbcount;
long req_time; long req_time;
#ifdef HAVE_TIMES #ifdef HAVE_TIMES
#ifdef _SC_CLK_TCK float tick;
float tick = sysconf(_SC_CLK_TCK);
#else
float tick = HZ;
#endif #endif
#endif int short_report;
int short_report = 0; int no_table_report;
int no_table_report = 0;
worker_score *ws_record; worker_score *ws_record;
process_score *ps_record; process_score *ps_record;
char *stat_buffer; char *stat_buffer;
@@ -267,6 +263,22 @@ static int status_handler(request_rec *r)
return DECLINED; return DECLINED;
} }
#ifdef HAVE_TIMES
#ifdef _SC_CLK_TCK
tick = sysconf(_SC_CLK_TCK);
#else
tick = HZ;
#endif
#endif
ready = 0;
busy = 0;
count = 0;
bcount = 0;
kbcount = 0;
short_report = 0;
no_table_report = 0;
pid_buffer = apr_palloc(r->pool, server_limit * sizeof(pid_t)); pid_buffer = apr_palloc(r->pool, server_limit * sizeof(pid_t));
stat_buffer = apr_palloc(r->pool, server_limit * thread_limit * sizeof(char)); stat_buffer = apr_palloc(r->pool, server_limit * thread_limit * sizeof(char));