From: Brian Pane Date: Mon, 22 Apr 2002 04:48:11 +0000 (+0000) Subject: Skip a potentially heavyweight call to sysconf, plus some X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=126554cff96d295ac839e3d1319667e617a439bc;p=apache 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 --- diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index bb5637e772..d0f0818ddc 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -240,22 +240,18 @@ static int status_handler(request_rec *r) apr_time_t nowtime; apr_interval_time_t up_time; int j, i, res; - int ready = 0; - int busy = 0; - unsigned long count = 0; + int ready; + int busy; + unsigned long count; unsigned long lres, my_lres, conn_lres; apr_off_t bytes, my_bytes, conn_bytes; - apr_off_t bcount = 0, kbcount = 0; + apr_off_t bcount, kbcount; long req_time; #ifdef HAVE_TIMES -#ifdef _SC_CLK_TCK - float tick = sysconf(_SC_CLK_TCK); -#else - float tick = HZ; -#endif + float tick; #endif - int short_report = 0; - int no_table_report = 0; + int short_report; + int no_table_report; worker_score *ws_record; process_score *ps_record; char *stat_buffer; @@ -267,6 +263,22 @@ static int status_handler(request_rec *r) 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)); stat_buffer = apr_palloc(r->pool, server_limit * thread_limit * sizeof(char));