]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r265033 from trunk.
authorColm MacCarthaigh <colm@apache.org>
Tue, 11 Oct 2005 16:25:16 +0000 (16:25 +0000)
committerColm MacCarthaigh <colm@apache.org>
Tue, 11 Oct 2005 16:25:16 +0000 (16:25 +0000)
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

CHANGES
modules/loggers/mod_log_config.c

diff --git a/CHANGES b/CHANGES
index 84fd56623b7e562f1bb71ec5cfe56bfaab345b7b..60754f24aad93ae7a4829e20ee29de696aa4539f 100644 (file)
--- 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]
 
index b0d7ec8c0b836c5929ed5cf1ac5715919de31e69..268096ff58c310fcdcd2c1e595491f5c0067a4ff 100644 (file)
@@ -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;