]> granicus.if.org Git - apache/commitdiff
change optional function to return the previous writer, allowing to have mutliple...
authorIan Holsman <ianh@apache.org>
Fri, 14 Feb 2003 04:17:34 +0000 (04:17 +0000)
committerIan Holsman <ianh@apache.org>
Fri, 14 Feb 2003 04:17:34 +0000 (04:17 +0000)
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

include/ap_mmn.h
modules/loggers/mod_log_config.c
modules/loggers/mod_log_config.h

index 54a2d06828b75d5d221844d8acdc1afaa7e2b0a6..84744b803574ac90b8408eba3ac6093a6982d325 100644 (file)
  * 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 */
 
index 08a3585e1b4426e524b2087ca2d7be0132522f43..27f3e5f9d51b9c9ae55798f9bb1ee9f820be1aba 100644 (file)
@@ -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,
index 600daac52ae651d8621418c3257cf1ab8d7df7af..7a9f1d55dbcff64097b1b88c287128923ba7150a 100644 (file)
@@ -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 */