From: Colm MacCarthaigh Date: Tue, 11 Oct 2005 16:25:16 +0000 (+0000) Subject: Merge r265033 from trunk. X-Git-Tag: 2.1.9~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de0c9cf981a0114bc66ecd901c66b763c15abf58;p=thirdparty%2Fapache%2Fhttpd.git Merge r265033 from trunk. Author: trawick Reviewed by: colm git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@312911 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 84fd56623b7..60754f24aad 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.1.9 + *) mod_log_config: %{hextid}P will log the thread id in hex with APR + versions 1.2.0 or higher. [Jeff Trawick] + *) httpd.exe/apachectl -V: display the DYNAMIC_MODULE_LIMIT setting, as in 1.3. [Jeff Trawick] diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index b0d7ec8c0b8..268096ff58c 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -650,13 +650,21 @@ static const char *log_pid_tid(request_rec *r, char *a) if (*a == '\0' || !strcmp(a, "pid")) { return ap_append_pid(r->pool, "", ""); } - else if (!strcmp(a, "tid")) { + else if (!strcmp(a, "tid") || !strcmp(a, "hextid")) { #if APR_HAS_THREADS apr_os_thread_t tid = apr_os_thread_current(); #else int tid = 0; /* APR will format "0" anyway but an arg is needed */ #endif - return apr_psprintf(r->pool, "%pT", &tid); + return apr_psprintf(r->pool, +#if APR_MAJOR_VERSION > 1 || (APR_MAJOR_VERSION == 1 && APR_MINOR_VERSION >= 2) + /* APR can format a thread id in hex */ + *a == 'h' ? "%pt" : "%pT", +#else + /* APR is missing the feature, so always use decimal */ + "%pT", +#endif + &tid); } /* bogus format */ return a;