From: Eric Covener Date: Tue, 15 Nov 2016 03:15:15 +0000 (+0000) Subject: reorganize mod_socache_redis so it compiles w/o apr-redis X-Git-Tag: 2.5.0-alpha~1010 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c7355d3c3f1a2bf0b86b36fd8b5953eb0b47831;p=thirdparty%2Fapache%2Fhttpd.git reorganize mod_socache_redis so it compiles w/o apr-redis It looks like this was the original intent. The provider is not registered if apr-redis is missing. It was previously failing to compile due to the dirconf being hidden behind the #ifdef guard but not the routine module code that used it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769712 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_socache_redis.c b/modules/cache/mod_socache_redis.c index b75336a9026..f7482445c07 100644 --- a/modules/cache/mod_socache_redis.c +++ b/modules/cache/mod_socache_redis.c @@ -21,21 +21,23 @@ #include "apr.h" #include "apu_version.h" -/* apr_redis support requires >= 1.6 */ -#if APU_MAJOR_VERSION > 1 || \ - (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION > 5) -#define HAVE_APU_REDIS 1 -#endif - -#ifdef HAVE_APU_REDIS - #include "ap_socache.h" #include "ap_mpm.h" #include "http_log.h" -#include "apr_redis.h" #include "apr_strings.h" #include "mod_status.h" +typedef struct { + apr_uint32_t ttl; + apr_uint32_t rwto; +} socache_rd_svr_cfg; + +/* apr_redis support requires >= 1.6 */ +#if APU_MAJOR_VERSION > 1 || \ + (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION > 5) +#define HAVE_APU_REDIS 1 +#endif + /* The underlying apr_redis system is thread safe.. */ #define RD_KEY_LEN 254 @@ -62,11 +64,8 @@ module AP_MODULE_DECLARE_DATA socache_redis_module; -typedef struct { - apr_uint32_t ttl; - apr_uint32_t rwto; -} socache_rd_svr_cfg; - +#ifdef HAVE_APU_REDIS +#include "apr_redis.h" struct ap_socache_instance_t { const char *servers; apr_redis_t *rc;