LogFileDateExt only generated with GMT (not a real bug)

Thorsten Ludewig ([email protected])
Wed, 23 Nov 1994 14:47:35 +0100


Hi,

the CERN httpd 3.0 generates the LogFileDateExt only with GMT ignoring
the LogTime switch to LocalTime.

I've written a small patch for the HTLog.c source to create the
LogFileDateExt with the local time if the LogTime is set to LocalTime
in the httpd.conf.

Bye bye Thorsten

ps. If the LogFileDateExt is set to %y%m%d you get a more useful
log-extension for scripts.

______________________________________________________________________
__________
/___ ___/|
|__/ /|__|/ Thorsten Ludewig
/ / / /|
/__/ / / / E-Mail: [email protected]
|__|/ /_/____ WWW-Homepage: http://www.fh-wolfenbuettel.de/~th/
/_________/| IRC-Nickname: Daimos
|_________|/

---- cut here ----
*** HTLog.c.orig Sun Sep 25 19:53:37 1994
--- HTLog.c Wed Nov 23 09:01:14 1994
***************
*** 56,68 ****
PRIVATE char * time_escapes ARGS1(CONST char *, filename)
{
time_t t;
! struct tm * gmt;
char * result;
char date[DATE_EXT_LEN+1];

/* If we have a date format to paste on the file names. Else use default */
time(&t);
! gmt = gmtime(&t);
result = malloc(strlen(filename)+DATE_EXT_LEN+2);
if (sc.log_file_date_ext) {

--- 56,72 ----
PRIVATE char * time_escapes ARGS1(CONST char *, filename)
{
time_t t;
! struct tm * gorl; /* GMT or localtime */
char * result;
char date[DATE_EXT_LEN+1];

/* If we have a date format to paste on the file names. Else use default */
time(&t);
! if (sc.use_gmt)
! gorl = gmtime(&t);
! else
! gorl = localtime(&t);
!
result = malloc(strlen(filename)+DATE_EXT_LEN+2);
if (sc.log_file_date_ext) {

***************
*** 70,85 ****
#if defined(Mips) || defined(_AUX) || (defined(VMS) && !defined(DECC))
/* A shortcut as we should use the value of log_file_date_ext ;-) */
sprintf(date, "%s%02d%02d",
! month_names[gmt->tm_mon], gmt->tm_mday, gmt->tm_year);
#else
! strftime(date, DATE_EXT_LEN, sc.log_file_date_ext, gmt);
#endif /* strftime() */
} else {
#if defined(Mips) || defined(_AUX) || (defined(VMS) && !defined(DECC))
sprintf(date, "%s%02d%02d",
! month_names[gmt->tm_mon], gmt->tm_mday, gmt->tm_year);
#else
! strftime(date, DATE_EXT_LEN, "%b%d%y", gmt);
#endif /* strftime() */
}
*(date+DATE_EXT_LEN) = '\0';
--- 74,89 ----
#if defined(Mips) || defined(_AUX) || (defined(VMS) && !defined(DECC))
/* A shortcut as we should use the value of log_file_date_ext ;-) */
sprintf(date, "%s%02d%02d",
! month_names[gorl->tm_mon], gorl->tm_mday, gorl->tm_year);
#else
! strftime(date, DATE_EXT_LEN, sc.log_file_date_ext, gorl);
#endif /* strftime() */
} else {
#if defined(Mips) || defined(_AUX) || (defined(VMS) && !defined(DECC))
sprintf(date, "%s%02d%02d",
! month_names[gorl->tm_mon], gorl->tm_mday, gorl->tm_year);
#else
! strftime(date, DATE_EXT_LEN, "%b%d%y", gorl);
#endif /* strftime() */
}
*(date+DATE_EXT_LEN) = '\0';