]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
reorganize mod_socache_redis so it compiles w/o apr-redis
authorEric Covener <covener@apache.org>
Tue, 15 Nov 2016 03:15:15 +0000 (03:15 +0000)
committerEric Covener <covener@apache.org>
Tue, 15 Nov 2016 03:15:15 +0000 (03:15 +0000)
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

modules/cache/mod_socache_redis.c

index b75336a902604c7f2d92c11c72735711c2fbccc5..f7482445c07fd6a1c063a2c35c845cc711e47f7c 100644 (file)
 #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
 
 
 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;