From ee05b36e774253e307b171ffdeb261c1f907ad75 Mon Sep 17 00:00:00 2001 From: laodc Date: Mon, 21 Aug 2023 16:29:28 +0700 Subject: [PATCH] changed errors to warnings. nullptr on contructor was never meant to be there --- lualib/lua_redis.lua | 2 +- src/libserver/redis_pool.cxx | 4 +--- src/libstat/backends/redis_backend.c | 4 +--- src/libstat/learn_cache/redis_cache.c | 4 +--- src/plugins/lua/bimi.lua | 3 +-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 377541f87..8ae40da5b 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -1521,7 +1521,7 @@ local function redis_connect_sync(redis_params, is_write, key, cfg, ev_base) conn:add_cmd('AUTH', { redis_params['username'], redis_params['password'] }) need_exec = true else - logger.errx('Redis requires a password when username is supplied') + logger.warnx('Redis requires a password when username is supplied') return false, nil, addr end elseif redis_params['password'] then diff --git a/src/libserver/redis_pool.cxx b/src/libserver/redis_pool.cxx index 34c09d055..a74eafd48 100644 --- a/src/libserver/redis_pool.cxx +++ b/src/libserver/redis_pool.cxx @@ -429,9 +429,7 @@ redis_pool_connection::redis_pool_connection(redis_pool *_pool, "AUTH %s %s", username.c_str(), password.c_str()); } else { - msg_err("Redis requires a password when username is supplied"); - redisAsyncFree(ctx); - return nullptr; + msg_warn("Redis requires a password when username is supplied"); } } else if (!password.empty()) { diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 72ffd6c44..8d3f730aa 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -369,9 +369,7 @@ rspamd_redis_maybe_auth(struct redis_stat_ctx *ctx, redisAsyncContext *redis) redisAsyncCommand(redis, NULL, NULL, "AUTH %s %s", ctx->username, ctx->password); } else { - msg_err("Redis requires a password when username is supplied"); - redisAsyncFree(ctx); - return NULL; + msg_warn("Redis requires a password when username is supplied"); } } else if (ctx->password) { diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index 0bbae8560..0a378c8a3 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -83,9 +83,7 @@ rspamd_redis_cache_maybe_auth(struct rspamd_redis_cache_ctx *ctx, redisAsyncCommand(redis, NULL, NULL, "AUTH %s %s", ctx->username, ctx->password); } else { - msg_err("Redis requires a password when username is supplied"); - redisAsyncFree(ctx); - return NULL; + msg_warn("Redis requires a password when username is supplied"); } } else if (ctx->password) { diff --git a/src/plugins/lua/bimi.lua b/src/plugins/lua/bimi.lua index 5053cc941..278359069 100644 --- a/src/plugins/lua/bimi.lua +++ b/src/plugins/lua/bimi.lua @@ -267,8 +267,7 @@ local function check_bimi_vmc(task, domain, record) if redis_params.password then password = string.format( '%s:%s@', redis_params.username, redis_params.password) else - rspamd_logger.errx(task, "Redis requires a password when username is supplied") - return + rspamd_logger.warnx(task, "Redis requires a password when username is supplied") end elseif redis_params.password then password = string.format(':%s@', redis_params.password) -- 2.39.5