aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-20 22:18:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-20 22:18:45 +0000
commitbc488cd48bb09799a6c8e9f2d08ac604a7a4c0c9 (patch)
tree8cc447adfab567b4929fce5c22424354d2d8aaa3 /src
parent62409ad0943ef71827d941aa41666c477f30e49c (diff)
downloadrspamd-bc488cd48bb09799a6c8e9f2d08ac604a7a4c0c9.tar.gz
rspamd-bc488cd48bb09799a6c8e9f2d08ac604a7a4c0c9.zip
[Minor] Remove obsolete WITH_HIREDIS define
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_utils.c4
-rw-r--r--src/libserver/fuzzy_backend/fuzzy_backend.c2
-rw-r--r--src/libserver/worker_util.c2
-rw-r--r--src/libstat/backends/backends.h5
-rw-r--r--src/libstat/backends/redis_backend.c4
-rw-r--r--src/libstat/learn_cache/learn_cache.h5
-rw-r--r--src/libstat/stat_config.c4
-rw-r--r--src/lua/lua_redis.c62
-rw-r--r--src/rspamadm/rspamadm.c3
9 files changed, 0 insertions, 91 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index cf80599ed..3f699a843 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -269,9 +269,7 @@ rspamd_config_new (enum rspamd_config_init_flags flags)
cfg->images_cache_size = 256;
cfg->monitored_ctx = rspamd_monitored_ctx_init ();
cfg->neighbours = ucl_object_typed_new (UCL_OBJECT);
-#ifdef WITH_HIREDIS
cfg->redis_pool = rspamd_redis_pool_init ();
-#endif
cfg->default_max_shots = DEFAULT_MAX_SHOTS;
cfg->max_sessions_cache = DEFAULT_MAX_SESSIONS;
cfg->maps_cache_dir = rspamd_mempool_strdup (cfg->cfg_pool, RSPAMD_DBDIR);
@@ -345,11 +343,9 @@ rspamd_config_free (struct rspamd_config *cfg)
lua_close (cfg->lua_state);
}
-#ifdef WITH_HIREDIS
if (cfg->redis_pool) {
rspamd_redis_pool_destroy (cfg->redis_pool);
}
-#endif
rspamd_upstreams_library_unref (cfg->ups_ctx);
HASH_CLEAR (hh, cfg->actions);
diff --git a/src/libserver/fuzzy_backend/fuzzy_backend.c b/src/libserver/fuzzy_backend/fuzzy_backend.c
index f6dec1d6e..548714e36 100644
--- a/src/libserver/fuzzy_backend/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend/fuzzy_backend.c
@@ -87,7 +87,6 @@ static const struct rspamd_fuzzy_backend_subr fuzzy_subrs[] = {
.periodic = rspamd_fuzzy_backend_expire_sqlite,
.close = rspamd_fuzzy_backend_close_sqlite,
},
-#ifdef WITH_HIREDIS
[RSPAMD_FUZZY_BACKEND_REDIS] = {
.init = rspamd_fuzzy_backend_init_redis,
.check = rspamd_fuzzy_backend_check_redis,
@@ -98,7 +97,6 @@ static const struct rspamd_fuzzy_backend_subr fuzzy_subrs[] = {
.periodic = rspamd_fuzzy_backend_expire_redis,
.close = rspamd_fuzzy_backend_close_redis,
}
-#endif
};
struct rspamd_fuzzy_backend {
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 474da2644..5b1b7765e 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -486,10 +486,8 @@ rspamd_prepare_worker (struct rspamd_worker *worker, const char *name,
rspamd_worker_init_signals (worker, event_loop);
rspamd_control_worker_add_default_cmd_handlers (worker, event_loop);
rspamd_worker_heartbeat_start (worker, event_loop);
-#ifdef WITH_HIREDIS
rspamd_redis_pool_config (worker->srv->cfg->redis_pool,
worker->srv->cfg, event_loop);
-#endif
/* Accept all sockets */
if (hdl) {
diff --git a/src/libstat/backends/backends.h b/src/libstat/backends/backends.h
index 434377850..4c0b2276b 100644
--- a/src/libstat/backends/backends.h
+++ b/src/libstat/backends/backends.h
@@ -115,13 +115,8 @@ struct rspamd_stat_backend {
RSPAMD_STAT_BACKEND_DEF(mmaped_file);
RSPAMD_STAT_BACKEND_DEF(sqlite3);
RSPAMD_STAT_BACKEND_DEF(cdb);
-
-#ifdef WITH_HIREDIS
-
RSPAMD_STAT_BACKEND_DEF(redis);
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index fdbb77f78..8536b80e3 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -19,8 +19,6 @@
#include "upstream.h"
#include "lua/lua_common.h"
#include "libserver/mempool_vars_internal.h"
-
-#ifdef WITH_HIREDIS
#include "hiredis.h"
#include "adapters/libev.h"
#include "ref.h"
@@ -2061,5 +2059,3 @@ rspamd_redis_load_tokenizer_config (gpointer runtime,
{
return NULL;
}
-
-#endif
diff --git a/src/libstat/learn_cache/learn_cache.h b/src/libstat/learn_cache/learn_cache.h
index 1816c9f7a..ad13ecf29 100644
--- a/src/libstat/learn_cache/learn_cache.h
+++ b/src/libstat/learn_cache/learn_cache.h
@@ -70,13 +70,8 @@ struct rspamd_stat_cache {
void rspamd_stat_cache_##name##_close (gpointer ctx)
RSPAMD_STAT_CACHE_DEF(sqlite3);
-
-#ifdef WITH_HIREDIS
-
RSPAMD_STAT_CACHE_DEF(redis);
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c
index 66c766836..c381c6904 100644
--- a/src/libstat/stat_config.c
+++ b/src/libstat/stat_config.c
@@ -91,9 +91,7 @@ static struct rspamd_stat_backend stat_backends[] = {
RSPAMD_STAT_BACKEND_ELT(mmap, mmaped_file),
RSPAMD_STAT_BACKEND_ELT(sqlite3, sqlite3),
RSPAMD_STAT_BACKEND_ELT_READONLY(cdb, cdb),
-#ifdef WITH_HIREDIS
RSPAMD_STAT_BACKEND_ELT(redis, redis)
-#endif
};
#define RSPAMD_STAT_CACHE_ELT(nam, eltn) { \
@@ -107,9 +105,7 @@ static struct rspamd_stat_backend stat_backends[] = {
static struct rspamd_stat_cache stat_caches[] = {
RSPAMD_STAT_CACHE_ELT(sqlite3, sqlite3),
-#ifdef WITH_HIREDIS
RSPAMD_STAT_CACHE_ELT(redis, redis),
-#endif
};
void
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
index 6085f6328..46202a520 100644
--- a/src/lua/lua_redis.c
+++ b/src/lua/lua_redis.c
@@ -89,7 +89,6 @@ static const struct luaL_reg redislib_m[] = {
#define REDIS_RELEASE REF_RELEASE
#endif
-#ifdef WITH_HIREDIS
struct lua_redis_request_specific_userdata;
/**
* Struct for userdata representation
@@ -1612,67 +1611,6 @@ lua_redis_exec (lua_State *L)
}
}
}
-#else
-static int
-lua_redis_make_request (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_make_request_sync (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_connect (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_connect_sync (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_add_cmd (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_exec (lua_State *L)
-{
- msg_warn ("rspamd is compiled with no redis support");
-
- lua_pushboolean (L, FALSE);
-
- return 1;
-}
-static int
-lua_redis_gc (lua_State *L)
-{
- return 0;
-}
-#endif
static gint
lua_load_redis (lua_State * L)
diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c
index 0eef24404..32897d7c0 100644
--- a/src/rspamadm/rspamadm.c
+++ b/src/rspamadm/rspamadm.c
@@ -488,10 +488,7 @@ main (gint argc, gchar **argv, gchar **env)
rspamd_lua_set_globals (cfg, L);
rspamadm_add_lua_globals (resolver);
-
-#ifdef WITH_HIREDIS
rspamd_redis_pool_config (cfg->redis_pool, cfg, rspamd_main->event_loop);
-#endif
/* Init rspamadm global */
lua_newtable (L);