From ab06871bb21a55789120c271eb6b7ad02033b95c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 25 Jun 2019 11:46:51 +0100 Subject: [PATCH] [Minor] Try to fix cmake stupidity --- CMakeLists.txt | 8 ++++---- src/libstat/backends/redis_backend.c | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8838892a9..3b3b768fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -875,10 +875,10 @@ CHECK_FUNCTION_EXISTS(vfork HAVE_VFORK) CHECK_FUNCTION_EXISTS(wait4 HAVE_WAIT4) CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID) CHECK_FUNCTION_EXISTS(flock HAVE_FLOCK) -CHECK_FUNCTION_EXISTS(tanhl HAVE_TANHL) -CHECK_FUNCTION_EXISTS(tanh HAVE_TANH) -CHECK_FUNCTION_EXISTS(expl HAVE_EXPL) -CHECK_FUNCTION_EXISTS(exp2l HAVE_EXP2L) +CHECK_LIBRARY_EXISTS(m tanhl HAVE_TANHL) +CHECK_LIBRARY_EXISTS(m tanh HAVE_TANH) +CHECK_LIBRARY_EXISTS(m expl HAVE_EXPL) +CHECK_LIBRARY_EXISTS(m exp2l HAVE_EXP2L) CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE) CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) CHECK_FUNCTION_EXISTS(setitimer HAVE_SETITIMER) diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 57a2c1343..43688cb7c 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -1588,6 +1588,16 @@ rspamd_redis_process_tokens (struct rspamd_task *task, rspamd_session_add_event (task->s, rspamd_redis_fin, rt, M); rt->has_event = TRUE; + query = rspamd_redis_tokens_to_query (task, rt, tokens, + rt->ctx->new_schema ? "HGET" : "HMGET", + rt->redis_object_expanded, FALSE, -1, + rt->stcf->clcf->flags & RSPAMD_FLAG_CLASSIFIER_INTEGER); + g_assert (query != NULL); + rspamd_mempool_add_destructor (task->task_pool, + (rspamd_mempool_destruct_t)rspamd_fstring_free, query); + + ret = redisAsyncFormattedCommand (rt->redis, rspamd_redis_processed, rt, + query->str, query->len); if (ev_is_active (&rt->timeout_event)) { rt->timeout_event.repeat = rt->ctx->timeout; @@ -1600,17 +1610,6 @@ rspamd_redis_process_tokens (struct rspamd_task *task, ev_timer_start (task->event_loop, &rt->timeout_event); } - query = rspamd_redis_tokens_to_query (task, rt, tokens, - rt->ctx->new_schema ? "HGET" : "HMGET", - rt->redis_object_expanded, FALSE, -1, - rt->stcf->clcf->flags & RSPAMD_FLAG_CLASSIFIER_INTEGER); - g_assert (query != NULL); - rspamd_mempool_add_destructor (task->task_pool, - (rspamd_mempool_destruct_t)rspamd_fstring_free, query); - - ret = redisAsyncFormattedCommand (rt->redis, rspamd_redis_processed, rt, - query->str, query->len); - if (ret == REDIS_OK) { return TRUE; } -- 2.39.5