]> source.dussan.org Git - rspamd.git/commitdiff
Add conditions for using redis stat backend
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jan 2016 23:54:09 +0000 (23:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jan 2016 23:54:09 +0000 (23:54 +0000)
src/libstat/backends/backends.h
src/libstat/backends/redis_backend.c
src/libstat/stat_config.c

index 148ab4fe8bc3f4277d009d170ee30d2988e6b3b1..1f0ebc1be21531e716d3f23ed05e4cc7ab13d9c0 100644 (file)
@@ -106,6 +106,8 @@ struct rspamd_stat_backend {
 
 RSPAMD_STAT_BACKEND_DEF(mmaped_file);
 RSPAMD_STAT_BACKEND_DEF(sqlite3);
+#ifdef WITH_HIREDIS
 RSPAMD_STAT_BACKEND_DEF(redis);
+#endif
 
 #endif /* BACKENDS_H_ */
index 7a3d59e2e3de35dc722f0c66562f0d6f63f0d94d..2eb0368410d6a4212655e5b81d004373df3ea523 100644 (file)
@@ -29,7 +29,7 @@
 #ifdef WITH_HIREDIS
 #include "hiredis/hiredis.h"
 #include "hiredis/adapters/libevent.h"
-#endif
+
 
 #define REDIS_CTX(p) (struct redis_stat_ctx *)(p)
 #define REDIS_RUNTIME(p) (struct redis_stat_runtime *)(p)
@@ -704,3 +704,6 @@ rspamd_redis_load_tokenizer_config (gpointer runtime,
 
        return NULL;
 }
+
+
+#endif
index e3943b6e0c0e5d86e161af44a043e43c31effcc6..319eebaeb615bb30a9f345e42cee722bcdd84a85 100644 (file)
@@ -72,7 +72,9 @@ static struct rspamd_stat_tokenizer stat_tokenizers[] = {
 static struct rspamd_stat_backend stat_backends[] = {
                RSPAMD_STAT_BACKEND_ELT(mmap, mmaped_file),
                RSPAMD_STAT_BACKEND_ELT(sqlite3, sqlite3),
+#ifdef WITH_HIREDIS
                RSPAMD_STAT_BACKEND_ELT(redis, redis)
+#endif
 };
 
 static struct rspamd_stat_cache stat_caches[] = {