From: Jacob Champion Date: Tue, 31 Jan 2017 18:56:33 +0000 (+0000) Subject: mod_crypto: improve error message with older APRs X-Git-Tag: 2.5.0-alpha~720 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9c18f9c1ca5ce7067e0f3adf6c0c54f4875ff04;p=apache mod_crypto: improve error message with older APRs When compiling against APR < 1.6, the actual error message was buried in unknown type errors from mod_crypto.h. Don't include that file at all if we're going to error out anyway. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781146 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_crypto.c b/modules/filters/mod_crypto.c index 38c1177ae9..2c98692c41 100644 --- a/modules/filters/mod_crypto.c +++ b/modules/filters/mod_crypto.c @@ -19,25 +19,28 @@ * stacks. */ +#include "apr_version.h" +#if !APR_VERSION_AT_LEAST(2,0,0) +#include "apu_version.h" +#endif + +#if !APR_VERSION_AT_LEAST(2,0,0) && \ + !(APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 6) +#error This module requires at least v1.6.0 of apr-util. +#else + #include "mod_crypto.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_crypto.h" #include "apr_base64.h" #include "apr_escape.h" -#include "apr_version.h" -#if !APR_VERSION_AT_LEAST(2,0,0) -#include "apu_version.h" -#endif #include "util_filter.h" #include "http_log.h" #include "http_request.h" #include "http_protocol.h" #include "ap_expr.h" -#if APR_VERSION_AT_LEAST(2,0,0) || \ - (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 6) - APR_HOOK_STRUCT(APR_HOOK_LINK(crypto_key) APR_HOOK_LINK(crypto_iv)) APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CRYPTO, apr_status_t, crypto_key, @@ -1308,6 +1311,4 @@ AP_DECLARE_MODULE(crypto) = { register_hooks /* register hooks */ }; -#else -#error This module requires at least v1.6.0 of apr-util. #endif