]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove obsolete WITH_HIREDIS define
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 Nov 2021 22:18:45 +0000 (22:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 Nov 2021 22:18:45 +0000 (22:18 +0000)
CMakeLists.txt
config.h.in
src/libserver/cfg_utils.c
src/libserver/fuzzy_backend/fuzzy_backend.c
src/libserver/worker_util.c
src/libstat/backends/backends.h
src/libstat/backends/redis_backend.c
src/libstat/learn_cache/learn_cache.h
src/libstat/stat_config.c
src/lua/lua_redis.c
src/rspamadm/rspamadm.c

index c4d7880689184d357a45a1b56a3444913ee6faad..386061b44db8b6ed8c52a9556e2a4579e2a85e98 100644 (file)
@@ -563,7 +563,6 @@ ENDIF(NOT DESTDIR)
 
 ################################ SUBDIRS SECTION ###########################
 ADD_SUBDIRECTORY(contrib/hiredis)
-SET(WITH_HIREDIS 1)
 INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis")
 
 LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
index 65daa3e2907787e4fed6f0ff28364d4da309fdbe..c24c0af6866045459e6a134b13150b7f131081a5 100644 (file)
 #cmakedefine PARAM_H_HAS_BITSET  1
 #cmakedefine WITH_DB             1
 #cmakedefine WITH_GPERF_TOOLS    1
-#cmakedefine WITH_HIREDIS        1
 #cmakedefine WITH_HYPERSCAN      1
 #cmakedefine WITH_JEMALLOC       1
 #cmakedefine WITH_LUA            1
index cf80599ed54657070207b59d0bc59b58f04c0f73..3f699a84300d1252c412d0c48c13bd9d01944c07 100644 (file)
@@ -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);
index f6dec1d6e27ed95f8ca749222d6a65c50186e5f0..548714e3634b4a6937e31844df0065d7a0b81aa5 100644 (file)
@@ -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 {
index 474da2644c658911cff377247c4a841454584058..5b1b7765e785b3c213bee836b9f2c4fcdd6253e4 100644 (file)
@@ -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) {
index 434377850c6fd3afbfb8608e5dc7cf4a0535a3b2..4c0b2276bcb13b76d947aa8927e50b6a42d805d5 100644 (file)
@@ -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
index fdbb77f78f85a0da0af15de2f17f329d2aa0694c..8536b80e38b82ec80b66804221688dacfbf025fa 100644 (file)
@@ -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
index 1816c9f7af2d1fcb03393ecbddd30149b35a6ae6..ad13ecf297c491955838f1cf12448d2e67a9f055 100644 (file)
@@ -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
index 66c7668366ad841745252c58f87b7478ff2e3962..c381c6904af0ddd30d6493369669e69c282f4fc4 100644 (file)
@@ -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
index 6085f63281773f0ee51047a474dc92e22af00d0c..46202a520d3114bc6e41aed0dbc840a49d331b6c 100644 (file)
@@ -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)
index 0eef24404262590122e0dbfee9472ae4acd87a4f..32897d7c00fef8e2d7dfcf24b420f4c8e18346c1 100644 (file)
@@ -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);