]> granicus.if.org Git - apache/commitdiff
allow unescaped errorlogs via compile time switch
authorAndré Malo <nd@apache.org>
Mon, 12 Jan 2004 21:19:58 +0000 (21:19 +0000)
committerAndré Malo <nd@apache.org>
Mon, 12 Jan 2004 21:19:58 +0000 (21:19 +0000)
Submitted by: Geoffrey Young <geoff modperlcookbook.org>

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

CHANGES
server/log.c

diff --git a/CHANGES b/CHANGES
index e081c532bcd30af8b9fca0f50497d4919c7bf3e9..b7394cfc6cdfbafae609011ab952fca381acb8cd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) Allow unescaped error logs via compile time switch
+     "-DAP_ERROR_LOG_UNESCAPED".
+     [Geoffrey Young <geoff modperlcookbook.org>, André Malo]
+
   *) proxy_http fix: mod_proxy hangs when both KeepAlive and 
      ProxyErrorOverride are enabled, and a non-200 response without a 
      body is generated by the backend server. (e.g.: a client makes a 
index b8ae92e45e57d33558c0fb8b35425413e63f2a57..9164db7ec4fb32ced9d727a82df162a22f26043e 100644 (file)
@@ -402,7 +402,10 @@ static void log_error_core(const char *file, int line, int level,
                            const request_rec *r, apr_pool_t *pool,
                            const char *fmt, va_list args)
 {
-    char errstr[MAX_STRING_LEN], scratch[MAX_STRING_LEN];
+    char errstr[MAX_STRING_LEN];
+#ifndef AP_ERROR_LOG_UNESCAPED
+    char scratch[MAX_STRING_LEN];
+#endif
     apr_size_t len, errstrlen;
     apr_file_t *logf = NULL;
     const char *referer;
@@ -539,15 +542,28 @@ static void log_error_core(const char *file, int line, int level,
     }
 
     errstrlen = len;
+#ifndef AP_ERROR_LOG_UNESCAPED
     if (apr_vsnprintf(scratch, MAX_STRING_LEN - len, fmt, args)) {
         len += ap_escape_errorlog_item(errstr + len, scratch,
                                        MAX_STRING_LEN - len);
     }
+#else
+    len += apr_vsnprintf(errstr + len, MAX_STRING_LEN - len, fmt, args);
+#endif
 
     if (   r && (referer = apr_table_get(r->headers_in, "Referer"))
-        && ap_escape_errorlog_item(scratch, referer, MAX_STRING_LEN - len)) {
+#ifndef AP_ERROR_LOG_UNESCAPED
+        && ap_escape_errorlog_item(scratch, referer, MAX_STRING_LEN - len)
+#endif
+        ) {
         len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
-                            ", referer: %s", scratch);
+                            ", referer: %s",
+#ifndef AP_ERROR_LOG_UNESCAPED
+                            scratch
+#else
+                            referer
+#endif
+                            );
     }
 
     /* NULL if we are logging to syslog */