You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2002/03/11 10:39:38 UTC

[patch modules/generators/mod_status.c]

this looks like a copy-n-paste porting bug. in httpd-2.0's scoreboard 
stop/start timestamps are in apr_time_t (==usecs only).

the problem wasn't noticed before since these structures are never set in 
workers. Any ideas why? See mod_status's output for yourself.

Index: modules/generators/mod_status.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_status.c,v
retrieving revision 1.54
diff -u -r1.54 mod_status.c
--- modules/generators/mod_status.c	4 Mar 2002 10:46:22 -0000	
1.54
+++ modules/generators/mod_status.c	11 Mar 2002 09:33:44 -0000
@@ -575,8 +575,7 @@
                     req_time = 0L;
                 else
                     req_time = (long)
-                        (((ws_record.stop_time - ws_record.start_time) * 
1000)
-                        + ((ws_record.stop_time - ws_record.start_time) / 
1000));
+                        ((ws_record.stop_time - ws_record.start_time) / 
1000);
 #endif
                 if (req_time < 0L)
                     req_time = 0L;




_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: [patch modules/generators/mod_status.c]

Posted by Jeff Trawick <tr...@attglobal.net>.
Stas Bekman <st...@stason.org> writes:

> On Mon, 11 Mar 2002, Stas Bekman wrote:
> 
> > this looks like a copy-n-paste porting bug. in httpd-2.0's scoreboard 
> > stop/start timestamps are in apr_time_t (==usecs only).
> > 
> > the problem wasn't noticed before since these structures are never set in 
> > workers. Any ideas why? See mod_status's output for yourself.

because unlike apache 1.3, nobody calls ap_time_process_request() :)

(no idea why)

> here is one more porting leftover fix, including the previous one:
> 
> Index: modules/generators/mod_status.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_status.c,v
> retrieving revision 1.54
> diff -u -r1.54 mod_status.c
> --- modules/generators/mod_status.c	4 Mar 2002 10:46:22 -0000	1.54
> +++ modules/generators/mod_status.c	11 Mar 2002 09:43:25 -0000
> @@ -570,13 +570,11 @@
>                  req_time = 0L;
>  #endif /* HAVE_TIMES */
>  #else
> -                if (ws_record.start_time == 0L
> -                    && ws_record.start_time == 0L)
> +                if (ws_record.start_time == 0L)
>                      req_time = 0L;
>                  else
>                      req_time = (long)
> -                        (((ws_record.stop_time - ws_record.start_time) * 1000)
> -                        + ((ws_record.stop_time - ws_record.start_time) / 1000));
> +                        ((ws_record.stop_time - ws_record.start_time) / 1000);
>  #endif
>                  if (req_time < 0L)
>                      req_time = 0L;

I'll commit this shortly.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: [patch modules/generators/mod_status.c]

Posted by Stas Bekman <st...@stason.org>.
On Mon, 11 Mar 2002, Stas Bekman wrote:

> this looks like a copy-n-paste porting bug. in httpd-2.0's scoreboard 
> stop/start timestamps are in apr_time_t (==usecs only).
> 
> the problem wasn't noticed before since these structures are never set in 
> workers. Any ideas why? See mod_status's output for yourself.

here is one more porting leftover fix, including the previous one:

Index: modules/generators/mod_status.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_status.c,v
retrieving revision 1.54
diff -u -r1.54 mod_status.c
--- modules/generators/mod_status.c	4 Mar 2002 10:46:22 -0000	1.54
+++ modules/generators/mod_status.c	11 Mar 2002 09:43:25 -0000
@@ -570,13 +570,11 @@
                 req_time = 0L;
 #endif /* HAVE_TIMES */
 #else
-                if (ws_record.start_time == 0L
-                    && ws_record.start_time == 0L)
+                if (ws_record.start_time == 0L)
                     req_time = 0L;
                 else
                     req_time = (long)
-                        (((ws_record.stop_time - ws_record.start_time) * 1000)
-                        + ((ws_record.stop_time - ws_record.start_time) / 1000));
+                        ((ws_record.stop_time - ws_record.start_time) / 1000);
 #endif
                 if (req_time < 0L)
                     req_time = 0L;

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/