From: Vsevolod Stakhov Date: Sat, 20 Nov 2021 22:18:45 +0000 (+0000) Subject: [Minor] Remove obsolete WITH_HIREDIS define X-Git-Tag: 3.2~243 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bc488cd48bb09799a6c8e9f2d08ac604a7a4c0c9;p=rspamd.git [Minor] Remove obsolete WITH_HIREDIS define --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c4d788068..386061b44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/config.h.in b/config.h.in index 65daa3e29..c24c0af68 100644 --- a/config.h.in +++ b/config.h.in @@ -107,7 +107,6 @@ #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 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);