diff options
author | Ian Holsman <ianh@apache.org> | 2003-02-14 04:17:34 +0000 |
---|---|---|
committer | Ian Holsman <ianh@apache.org> | 2003-02-14 04:17:34 +0000 |
commit | 7f5768e1876c8e0b8b0b319f273727ecfac3803a (patch) | |
tree | 5a6599fe12ef8183582883f4769d3e5927b0b674 /modules/loggers | |
parent | 34850f47e54459388b4afa0c8fd7c73e625638e9 (diff) | |
download | httpd-7f5768e1876c8e0b8b0b319f273727ecfac3803a.tar.gz |
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
Diffstat (limited to 'modules/loggers')
-rw-r--r-- | modules/loggers/mod_log_config.c | 14 | ||||
-rw-r--r-- | modules/loggers/mod_log_config.h | 4 |
2 files changed, 12 insertions, 6 deletions
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 */ |