Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 38928 invoked by uid 500); 22 Apr 2002 04:48:13 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 38917 invoked by uid 500); 22 Apr 2002 04:48:13 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 22 Apr 2002 04:48:11 -0000 Message-ID: <20020422044811.60955.qmail@icarus.apache.org> From: brianp@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/generators mod_status.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brianp 02/04/21 21:48:11 Modified: modules/generators mod_status.c Log: 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 Revision Changes Path 1.67 +23 -11 httpd-2.0/modules/generators/mod_status.c Index: mod_status.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -r1.66 -r1.67 --- mod_status.c 9 Apr 2002 11:18:41 -0000 1.66 +++ mod_status.c 22 Apr 2002 04:48:11 -0000 1.67 @@ -240,22 +240,18 @@ 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; @@ -266,6 +262,22 @@ strcmp(r->handler, "server-status")) { 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));