From: Eric Covener Date: Tue, 15 Jul 2014 13:30:59 +0000 (+0000) Subject: allow two character mod_log_config formats X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db8fc6883037e8c8b4b7b02287876a9ae732f0fe;p=thirdparty%2Fapache%2Fhttpd.git allow two character mod_log_config formats git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610686 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8bb4974e20c..973c3748cf9 100644 --- a/CHANGES +++ b/CHANGES @@ -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] diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 8313af68a04..624165146e0 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -917,7 +917,7 @@ static char *parse_log_misc_string(apr_pool_t *p, log_format_item *it, 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 *p, log_format_item *it, const char **sa) 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_pool_t *p, char *tag, 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) {