From: Rainer Jung Date: Wed, 23 Jul 2014 19:53:22 +0000 (+0000) Subject: Add compiled and loaded PCRE version numbers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eea8203531e220a401bb8a0b94716a0a95b73816;p=thirdparty%2Fapache%2Fhttpd.git Add compiled and loaded PCRE version numbers 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 --- diff --git a/CHANGES b/CHANGES index baa756cdb3b..f549df80464 100644 --- 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] diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index e5e63de1378..481d88decd6 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -453,6 +453,12 @@ static int show_server_settings(request_rec * r) "
Compiled with APU Version: " "%s
\n", APU_VERSION_STRING); #endif + ap_rprintf(r, + "
Server loaded PCRE Version: " + "%s
\n", ap_pcre_version_string(AP_REG_PCRE_LOADED)); + ap_rprintf(r, + "
Compiled with PCRE Version: " + "%s
\n", ap_pcre_version_string(AP_REG_PCRE_COMPILED)); ap_rprintf(r, "
Module Magic Number: " "%d:%d
\n", MODULE_MAGIC_NUMBER_MAJOR, diff --git a/server/main.c b/server/main.c index fc2d22c8e93..1acf64534eb 100644 --- a/server/main.c +++ b/server/main.c @@ -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 diff --git a/server/util_pcre.c b/server/util_pcre.c index 4d2adef25b6..22eb33cf663 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -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) {