diff options
author | Ian Holsman <ianh@apache.org> | 2003-02-14 05:17:34 +0100 |
---|---|---|
committer | Ian Holsman <ianh@apache.org> | 2003-02-14 05:17:34 +0100 |
commit | 7f5768e1876c8e0b8b0b319f273727ecfac3803a (patch) | |
tree | 5a6599fe12ef8183582883f4769d3e5927b0b674 | |
parent | people often assume that their Aliases will be found by "best match" rather (diff) | |
download | apache2-7f5768e1876c8e0b8b0b319f273727ecfac3803a.tar.xz apache2-7f5768e1876c8e0b8b0b319f273727ecfac3803a.zip |
change optional function to return the previous writer, allowing to have mutliple types
of writers in the same server. (previously you could only have one)
it needs a mmn bump.. sorry guys
;(
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98648 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/ap_mmn.h | 3 | ||||
-rw-r--r-- | modules/loggers/mod_log_config.c | 14 | ||||
-rw-r--r-- | modules/loggers/mod_log_config.h | 4 |
3 files changed, 14 insertions, 7 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 54a2d06828..84744b8035 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -112,12 +112,13 @@ * 20020628 (2.0.40-dev) Added filter_init to filter registration functions * 20020903 (2.0.41-dev) APR's error constants changed * 20020903.1 (2.1.0-dev) allow_encoded_slashes added to core_dir_config + * 20030213.1 (2.1.0-dev) changed log_writer optional fn's to return previous handler */ #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 20020903 +#define MODULE_MAGIC_NUMBER_MAJOR 20030213 #endif #define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 08a3585e1b..27f3e5f9d5 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -230,8 +230,8 @@ static void *ap_default_log_writer_init(apr_pool_t *p, server_rec *s, static void *ap_buffered_log_writer_init(apr_pool_t *p, server_rec *s, const char* name); -static void ap_log_set_writer_init(ap_log_writer_init *handle); -static void ap_log_set_writer(ap_log_writer *handle); +static ap_log_writer_init* ap_log_set_writer_init(ap_log_writer_init *handle); +static ap_log_writer* ap_log_set_writer(ap_log_writer *handle); static ap_log_writer *log_writer = ap_default_log_writer; static ap_log_writer_init *log_writer_init = ap_default_log_writer_init; static int buffered_logs = 0; /* default unbuffered */ @@ -1223,14 +1223,20 @@ static void ap_register_log_handler(apr_pool_t *p, char *tag, apr_hash_set(log_hash, tag, 1, (const void *)log_struct); } -static void ap_log_set_writer_init(ap_log_writer_init *handle) +static ap_log_writer_init* ap_log_set_writer_init(ap_log_writer_init *handle) { + ap_log_writer_init *old = log_writer_init; log_writer_init = handle; + return old; + } -static void ap_log_set_writer(ap_log_writer *handle) +static ap_log_writer *ap_log_set_writer(ap_log_writer *handle) { + ap_log_writer *old = log_writer; log_writer = handle; + + return old; } static apr_status_t ap_default_log_writer( request_rec *r, diff --git a/modules/loggers/mod_log_config.h b/modules/loggers/mod_log_config.h index 600daac52a..7a9f1d55db 100644 --- a/modules/loggers/mod_log_config.h +++ b/modules/loggers/mod_log_config.h @@ -96,10 +96,10 @@ APR_DECLARE_OPTIONAL_FN(void, ap_register_log_handler, * you will need to set your init handler *BEFORE* the open_logs * in mod_log_config gets executed */ -APR_DECLARE_OPTIONAL_FN(void, ap_log_set_writer_init,(ap_log_writer_init *func)); +APR_DECLARE_OPTIONAL_FN(ap_log_writer_init*, ap_log_set_writer_init,(ap_log_writer_init *func)); /** * you should probably set the writer at the same time (ie..before open_logs) */ -APR_DECLARE_OPTIONAL_FN(void, ap_log_set_writer, (ap_log_writer* func)); +APR_DECLARE_OPTIONAL_FN(ap_log_writer*, ap_log_set_writer, (ap_log_writer* func)); #endif /* MOD_LOG_CONFIG */ |