]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some misuse cases
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 13 May 2022 21:11:27 +0000 (22:11 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 13 May 2022 21:11:27 +0000 (22:11 +0100)
src/libserver/logger.h
src/libserver/symcache/symcache_runtime.cxx

index 8f1177666ddf4f259a9ae9321e52d1d2a5f98d6b..ae3ea469495b8c2e0582d7d8dca5da17d84f4357 100644 (file)
@@ -302,6 +302,10 @@ extern guint rspamd_task_log_id;
         task->task_pool->tag.tagname, task->task_pool->tag.uid, \
         RSPAMD_LOG_FUNC, \
         __VA_ARGS__)
+#define msg_info_task_lambda(...)   rspamd_default_log_function (G_LOG_LEVEL_INFO, \
+        task->task_pool->tag.tagname, task->task_pool->tag.uid, \
+        log_func, \
+        __VA_ARGS__)
 #define msg_debug_task(...)  rspamd_conditional_debug_fast (NULL,  task->from_addr, \
         rspamd_task_log_id, "task", task->task_pool->tag.uid, \
         RSPAMD_LOG_FUNC, \
index 6c0af2b4728deae9dd03a59318dc309aed78906a..788a36ec9cdbd20956d18e354177996ad387b142 100644 (file)
@@ -151,6 +151,9 @@ symcache_runtime::process_settings(struct rspamd_task *task, const symcache &cac
                disable_symbol(task, cache, sym);
        });
 
+       /* Update required limit */
+       lim = rspamd_task_get_required_score(task, task->result);
+
        return false;
 }
 
@@ -317,6 +320,7 @@ symcache_runtime::process_pre_postfilters(struct rspamd_task *task,
 {
        auto saved_priority = std::numeric_limits<int>::min();
        auto all_done = true;
+       auto log_func = RSPAMD_LOG_FUNC;
        auto compare_functor = +[](int a, int b) { return a < b; };
 
        auto proc_func = [&](cache_item *item) {
@@ -328,8 +332,9 @@ symcache_runtime::process_pre_postfilters(struct rspamd_task *task,
                if (stage != RSPAMD_TASK_STAGE_IDEMPOTENT &&
                        !(item->flags & SYMBOL_TYPE_IGNORE_PASSTHROUGH)) {
                        if (check_metric_limit(task)) {
-                               msg_info_task("task has already the result being set, ignore further checks");
-                               return false;
+                               msg_info_task_lambda("task has already the result being set, ignore further checks");
+
+                               return true;
                        }
                }