You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2016/11/15 03:15:15 UTC

svn commit: r1769712 - /httpd/httpd/trunk/modules/cache/mod_socache_redis.c

Author: covener
Date: Tue Nov 15 03:15:15 2016
New Revision: 1769712

URL: http://svn.apache.org/viewvc?rev=1769712&view=rev
Log:
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.



Modified:
    httpd/httpd/trunk/modules/cache/mod_socache_redis.c

Modified: httpd/httpd/trunk/modules/cache/mod_socache_redis.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_redis.c?rev=1769712&r1=1769711&r2=1769712&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_redis.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_redis.c Tue Nov 15 03:15:15 2016
@@ -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;