]> granicus.if.org Git - apache/commitdiff
change the log_writer declaration so that it takes a request_rec instead of
authorIan Holsman <ianh@apache.org>
Fri, 6 Sep 2002 03:00:11 +0000 (03:00 +0000)
committerIan Holsman <ianh@apache.org>
Fri, 6 Sep 2002 03:00:11 +0000 (03:00 +0000)
just a pool.
(so that the writer can get to things like hostname)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96666 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_config.c
modules/loggers/mod_log_config.h

index ed661d06bd717453ca6abbd1a02d4ceb1fdfa21f..e6b0efbcd4c617eed767338da7475935c209326b 100644 (file)
@@ -213,13 +213,13 @@ module AP_MODULE_DECLARE_DATA log_config_module;
 static int xfer_flags = (APR_WRITE | APR_APPEND | APR_CREATE);
 static apr_fileperms_t xfer_perms = APR_OS_DEFAULT;
 static apr_hash_t *log_hash;
-static apr_status_t ap_default_log_writer(apr_pool_t *p,  
+static apr_status_t ap_default_log_writer(request_rec *r,
                            void *handle, 
                            const char **strs,
                            int *strl,
                            int nelts,
                            apr_size_t len);
-static apr_status_t ap_buffered_log_writer(apr_pool_t *p,  
+static apr_status_t ap_buffered_log_writer(request_rec *r,
                            void *handle, 
                            const char **strs,
                            int *strl,
@@ -895,7 +895,7 @@ static int config_log_transaction(request_rec *r, config_log_state *cls,
                 "log writer isn't correctly setup");
          return HTTP_INTERNAL_SERVER_ERROR;
     }
-    rv = log_writer(r->pool, cls->log_writer, strs, strl, format->nelts, len);
+    rv = log_writer(r, cls->log_writer, strs, strl, format->nelts, len);
     /* xxx: do we return an error on log_writer? */
     return OK;
 }
@@ -1233,7 +1233,7 @@ static void ap_log_set_writer(ap_log_writer *handle)
     log_writer = handle;
 }
 
-static apr_status_t ap_default_log_writer(apr_pool_t *p,  
+static apr_status_t ap_default_log_writer( request_rec *r,
                            void *handle, 
                            const char **strs,
                            int *strl,
@@ -1246,7 +1246,7 @@ static apr_status_t ap_default_log_writer(apr_pool_t *p,
     int i;
     apr_status_t rv;
 
-    str = apr_palloc(p, len + 1);
+    str = apr_palloc(r->pool, len + 1);
 
     for (i = 0, s = str; i < nelts; ++i) {
         memcpy(s, strs[i], strl[i]);
@@ -1302,7 +1302,7 @@ static void *ap_buffered_log_writer_init(apr_pool_t *p, server_rec *s,
     else
         return NULL;
 }
-static apr_status_t ap_buffered_log_writer(apr_pool_t *p,  
+static apr_status_t ap_buffered_log_writer(request_rec *r,
                                            void *handle, 
                                            const char **strs,
                                            int *strl,
@@ -1323,7 +1323,7 @@ static apr_status_t ap_buffered_log_writer(apr_pool_t *p,
     if (len >= LOG_BUFSIZE) {
         apr_size_t w;
 
-        str = apr_palloc(p, len + 1);
+        str = apr_palloc(r->pool, len + 1);
         for (i = 0, s = str; i < nelts; ++i) {
             memcpy(s, strs[i], strl[i]);
             s += strl[i];
index 8bbadfcfd8e72bbb8092758744c11f3251d50528..4769bbbbb7ebb4a4f4682fa5936a504231550b89 100644 (file)
@@ -76,7 +76,8 @@ typedef void *ap_log_writer_init(apr_pool_t *p, server_rec *s,
 /**
  * callback which gets called where there is a log line to write.
  */
-typedef apr_status_t ap_log_writer(apr_pool_t *p, 
+typedef apr_status_t ap_log_writer(
+                            request_rec *r,
                             void *handle, 
                             const char **portions,
                             int *lengths,