Date: Wed, 17 Jul 2002 01:50:30 +0200 From: Wolter Kamphuis MIME-Version: 1.0 To: A.Ford@ford-mason.co.uk Subject: mod_cronolog patch Content-Type: multipart/mixed; boundary="------------000907040805010703010106" This is a multi-part message in MIME format. --------------000907040805010703010106 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Andrew, Yesterday I wrote you I'd found a bug in your cronolog-apache module, I think I found the source of the bug. I saw the 'log_request_time' function in mod_cronolog.c is different as the 'log_request_time' function in the 'mod_log_config' of my apache-1.3.26 distribution. I simply replaced your function with apache's function and I don't see any wrong timestamps anymore (after 60k hits). I'm not a programmer so I can't tell whats wrong but I guess you can. Anway, thanks for building cronolog, it now works perfectly again. mzzl Wolter Kamphuis p.s. I attached a diff of your normal and my modified mod_cronolog.c -- Unsubscribe: send email to devnull@wkamphuis.student.utwente.nl and put 'unsubscribe life' in the subject header of the message --------------000907040805010703010106 Content-Type: text/plain; name="mod_cronolog.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mod_cronolog.c.patch" --- mod_cronolog.c 2002-07-17 01:45:27.000000000 +0200 +++ mod_cronolog.c.modified 2002-07-17 01:45:27.000000000 +0200 @@ -187,6 +187,7 @@ #include "http_log.h" #include #include "cronoutils.h" +#include "ap_compat.h" /* mod_cronolog: change module name */ module MODULE_VAR_EXPORT cronolog_module; @@ -483,24 +484,24 @@ static const char *log_request_time(request_rec *r, char *a) { - /* mod_cronolog: use global log time variables */ - + int timz; + struct tm *t; char tstr[MAX_STRING_LEN]; + t = ap_get_gmtoff(&timz); + if (a && *a) { /* Custom format */ - strftime(tstr, MAX_STRING_LEN, a, log_time_tm); + strftime(tstr, MAX_STRING_LEN, a, t); } else { /* CLF format */ - char sign = (log_time_tz < 0 ? '-' : '+'); - int timz = log_time_tz; + char sign = (timz < 0 ? '-' : '+'); if (timz < 0) { timz = -timz; } ap_snprintf(tstr, sizeof(tstr), "[%02d/%s/%d:%02d:%02d:%02d %c%.2d%.2d]", - log_time_tm->tm_mday, ap_month_snames[log_time_tm->tm_mon], - log_time_tm->tm_year+1900, - log_time_tm->tm_hour, log_time_tm->tm_min, log_time_tm->tm_sec, + t->tm_mday, ap_month_snames[t->tm_mon], t->tm_year+1900, + t->tm_hour, t->tm_min, t->tm_sec, sign, timz / 60, timz % 60); } --------------000907040805010703010106--