merge config support bug in 1.19b

"Edward Rudd" <[email protected]> Mon, 22 Dec 2003 14:14:39 -0600
Newsgroups gmane.comp.apache.mod-log-sql
Organization Me Organized?
Message-ID <[email protected]>
The merge server config function is only called for merges of config
record.  it is never called for the default server, so the default server
never has the defaults assigned to it, thus leading to some nice breakage
if you try to log things for the default server.

There are two ways of solving this..
In Apache 2.0 you can use the post_config hook.. However in apache 1.3
that does not exist.. Fro apache 1.3 you can do nice *voodoo* though..

Create Defines for all of the defaults..

#define DEFAULT_TRANSFER_LOG_FMT "AbHhmRSsTUuv"
#define DEFAULT_NOTES_TABLE_NAME "notes"
etc...

then in the merge function to this..
merged->transfer_log_format =
	child->transfer_log_format!=DEFAULT_TRANSFER_LOG_FMT ?
	child->transfer_log_format : parent->transfer_log_format;

That is it. This may seem like it won't work but it will.. since
DEFAULT_TRANSFER_LOG_FMT is a string constant the pointer will always be
the same.. however, if the user configures some different value (even the
same value as the default) it will have a different pointer and thus the
compare will correctly fail and the child value will be assigned.

Edward Rudd


____________________________________________________________________
Reminder: to unsubscribe, send email to <[email protected]>
with the words "unsubscribe mod_log_sql" in the body (w/o quotes).
The module homepage is http://www.grubbybaby.com/mod_log_sql/
The list archives are here:
http://news.gmane.org/thread.php?group=gmane.comp.apache.mod-log-sql