httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alois Treindl <al...@astro.ch>
Subject Re: [users@httpd] apache 2.0 accesslog timestamp differs from apache 1.3
Date Sun, 20 Jun 2004 11:34:34 GMT
Nick Kew wrote:

> 
> 
> Developers sometimes make changes requested by users: I've written more
> than one new module in response to - for example - a passing request
> (or a "why can't it do?" question) on #apache[1], or a need identified
> in a Usenet thread[2].  But I doubt your attitude above has made you many
> friends.
> 

OK.

I have learned how to create and apply a patch, and made a patched 
mod_log_config.so for my purpose.

In the process, I discovered an actual bug in mod_log_config.c

The code is:
static const char *log_request_time(request_rec *r, char *a)
...
#ifdef I_INSIST_ON_EXTRA_CYCLES_FOR_CLF_COMPLIANCE
         apr_time_t request_time = apr_time_now();
#else
         apr_time_t request_time = r->request_time;
#endif
         unsigned t_seconds = (unsigned)apr_time_sec(request_time);
         unsigned i = t_seconds & TIME_CACHE_MASK;
         memcpy(cached_time, &(request_time_cache[i]), 
sizeof(*cached_time));
         if ((t_seconds != cached_time->t) ||
             (t_seconds != cached_time->t_validate)) {

             /* Invalid or old snapshot, so compute the proper time string
              * and store it in the cache
              */
             char sign;
             int timz;

             ap_explode_recent_localtime(&xt, r->request_time);


The last line is wrong: it uses r->request_time instead of the local
variable request_time.

It should be
ap_explode_recent_localtime(&xt, request_time);

I have submitted the bug to apache bugzilla.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message