]> granicus.if.org Git - apache/commitdiff
Add compiled and loaded PCRE version numbers
authorRainer Jung <rjung@apache.org>
Wed, 23 Jul 2014 19:53:22 +0000 (19:53 +0000)
committerRainer Jung <rjung@apache.org>
Wed, 23 Jul 2014 19:53:22 +0000 (19:53 +0000)
to "httpd -V" output and to mod_info page.

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

CHANGES
modules/generators/mod_info.c
server/main.c
server/util_pcre.c

diff --git a/CHANGES b/CHANGES
index baa756cdb3b82d39a09f1ec1badbb990e440bd5d..f549df80464933c4439960bbd66416b5fe68559c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core, mod_info: Add compiled and loaded PCRE versions to version
+     number display.  [Rainer Jung]
+
   *) mpm_winnt: Accept utf-8 (Unicode) service names and descriptions for
      internationalization.  [William Rowe]
 
index e5e63de1378413f2ffa77bd39d3ad79e76f53f12..481d88decd6cbfd6c27ae83cb536b75f65632762 100644 (file)
@@ -453,6 +453,12 @@ static int show_server_settings(request_rec * r)
                "<dt><strong>Compiled with APU Version:</strong> "
                "<tt>%s</tt></dt>\n", APU_VERSION_STRING);
 #endif
+    ap_rprintf(r,
+               "<dt><strong>Server loaded PCRE Version:</strong> "
+               "<tt>%s</tt></dt>\n", ap_pcre_version_string(AP_REG_PCRE_LOADED));
+    ap_rprintf(r,
+               "<dt><strong>Compiled with PCRE Version:</strong> "
+               "<tt>%s</tt></dt>\n", ap_pcre_version_string(AP_REG_PCRE_COMPILED));
     ap_rprintf(r,
                "<dt><strong>Module Magic Number:</strong> "
                "<tt>%d:%d</tt></dt>\n", MODULE_MAGIC_NUMBER_MAJOR,
index fc2d22c8e93cf1548d4100ec6e62f1c26764b54b..1acf64534eb23d41ebbb077b73946746a66984c3 100644 (file)
@@ -107,13 +107,17 @@ static void show_compile_settings(void)
     printf("Server's Module Magic Number: %u:%u\n",
            MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
 #if APR_MAJOR_VERSION >= 2
-    printf("Server loaded:  APR %s\n", apr_version_string());
-    printf("Compiled using: APR %s\n", APR_VERSION_STRING);
+    printf("Server loaded:  APR %s, PCRE %s\n",
+           apr_version_string(), ap_pcre_version_string(AP_REG_PCRE_LOADED));
+    printf("Compiled using: APR %s, PCRE %s\n",
+           APR_VERSION_STRING, ap_pcre_version_string(AP_REG_PCRE_COMPILED));
 #else
-    printf("Server loaded:  APR %s, APR-UTIL %s\n",
-           apr_version_string(), apu_version_string());
-    printf("Compiled using: APR %s, APR-UTIL %s\n",
-           APR_VERSION_STRING, APU_VERSION_STRING);
+    printf("Server loaded:  APR %s, APR-UTIL %s, PCRE %s\n",
+           apr_version_string(), apu_version_string(),
+           ap_pcre_version_string(AP_REG_PCRE_LOADED));
+    printf("Compiled using: APR %s, APR-UTIL %s, PCRE %s\n",
+           APR_VERSION_STRING, APU_VERSION_STRING,
+           ap_pcre_version_string(AP_REG_PCRE_COMPILED));
 #endif
     /* sizeof(foo) is long on some platforms so we might as well
      * make it long everywhere to keep the printf format
index 4d2adef25b67d20f430a568808d2d5eca5ccbd5c..22eb33cf6639d38da433eea23df937bfd4a62bb9 100644 (file)
@@ -67,6 +67,18 @@ static const char *const pstring[] = {
     "match failed"              /* AP_REG_NOMATCH */
 };
 
+AP_DECLARE(const char *) ap_pcre_version_string(int which)
+{
+    switch (which) {
+    case AP_REG_PCRE_COMPILED:
+        return APR_STRINGIFY(PCRE_MAJOR) "." APR_STRINGIFY(PCRE_MINOR) " " APR_STRINGIFY(PCRE_DATE);
+    case AP_REG_PCRE_LOADED:
+        return pcre_version();
+    default:
+        return "Unknown";
+    }
+}
+
 AP_DECLARE(apr_size_t) ap_regerror(int errcode, const ap_regex_t *preg,
                                    char *errbuf, apr_size_t errbuf_size)
 {