httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1610686 - in /httpd/httpd/trunk: CHANGES modules/loggers/mod_log_config.c
Date Tue, 15 Jul 2014 13:30:59 GMT
Author: covener
Date: Tue Jul 15 13:30:59 2014
New Revision: 1610686

URL: http://svn.apache.org/r1610686
Log:
allow two character mod_log_config formats


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/loggers/mod_log_config.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1610686&r1=1610685&r2=1610686&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Jul 15 13:30:59 2014
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_log_config: Allow two character log formats to be registered and used.
+     [Eric Covener]
+
   *) mod_ssl: Extend the scope of SSLSessionCacheTimeout to sessions
      resumed by TLS session resumption (RFC 5077). [Rainer Jung]
 

Modified: httpd/httpd/trunk/modules/loggers/mod_log_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_config.c?rev=1610686&r1=1610685&r2=1610686&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_log_config.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_log_config.c Tue Jul 15 13:30:59 2014
@@ -917,7 +917,7 @@ static char *parse_log_misc_string(apr_p
 static char *parse_log_item(apr_pool_t *p, log_format_item *it, const char **sa)
 {
     const char *s = *sa;
-    ap_log_handler *handler;
+    ap_log_handler *handler = NULL;
 
     if (*s != '%') {
         return parse_log_misc_string(p, it, sa);
@@ -987,7 +987,16 @@ static char *parse_log_item(apr_pool_t *
             break;
 
         default:
-            handler = (ap_log_handler *)apr_hash_get(log_hash, s++, 1);
+            /* check for exactly two character format first */
+            if (*(s+1)) { 
+                handler = (ap_log_handler *)apr_hash_get(log_hash, s, 2); 
+                if (handler) { 
+                   s += 2;
+                }
+            }
+            if (!handler) {  
+                handler = (ap_log_handler *)apr_hash_get(log_hash, s++, 1);  
+            }
             if (!handler) {
                 char dummy[2];
 
@@ -1550,7 +1559,7 @@ static void ap_register_log_handler(apr_
     log_struct->func = handler;
     log_struct->want_orig_default = def;
 
-    apr_hash_set(log_hash, tag, 1, (const void *)log_struct);
+    apr_hash_set(log_hash, tag, strlen(tag), (const void *)log_struct);
 }
 static ap_log_writer_init *ap_log_set_writer_init(ap_log_writer_init *handle)
 {



Mime
View raw message