]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix finalization for internal plugins
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 21 Oct 2018 09:31:41 +0000 (10:31 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 21 Oct 2018 09:31:41 +0000 (10:31 +0100)
src/plugins/dkim_check.c
src/plugins/fuzzy_check.c
src/plugins/regexp.c
src/plugins/spf.c
src/plugins/surbl.c

index da42fe14fe0d38139823f0334c8c085bc2f6cb9e..30dbe7b0220aa28a09a811cec6a47d2ab3e3fea6 100644 (file)
@@ -1235,6 +1235,9 @@ dkim_symbol_callback (struct rspamd_task *task,
                rspamd_symcache_item_async_inc (task, item);
                dkim_module_check (res);
        }
+       else {
+               rspamd_symbols_cache_finalize_item (task, item);
+       }
 }
 
 static void
index 79ae230cf4e9a93cd580b6cbe5c1a0b20134a5fc..751ee2affc70c381732c09a644440e9bc1c35511 100644 (file)
@@ -2897,6 +2897,8 @@ fuzzy_symbol_callback (struct rspamd_task *task,
        struct fuzzy_ctx *fuzzy_module_ctx = fuzzy_get_context (task->cfg);
 
        if (!fuzzy_module_ctx->enabled) {
+               rspamd_symbols_cache_finalize_item (task, item);
+
                return;
        }
 
@@ -2907,10 +2909,14 @@ fuzzy_symbol_callback (struct rspamd_task *task,
                        msg_info_task ("<%s>, address %s is whitelisted, skip fuzzy check",
                                task->message_id,
                                rspamd_inet_address_to_string (task->from_addr));
+                       rspamd_symbols_cache_finalize_item (task, item);
+
                        return;
                }
        }
 
+       rspamd_symcache_item_async_inc (task, item);
+
        PTR_ARRAY_FOREACH (fuzzy_module_ctx->fuzzy_rules, i, rule) {
                commands = fuzzy_generate_commands (task, rule, FUZZY_CHECK, 0, 0, 0);
 
@@ -2918,6 +2924,8 @@ fuzzy_symbol_callback (struct rspamd_task *task,
                        register_fuzzy_client_call (task, rule, commands);
                }
        }
+
+       rspamd_symcache_item_async_dec_check (task, item);
 }
 
 void
@@ -3040,6 +3048,7 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent,
                        rspamd_task_free (task);
                        rspamd_controller_send_error (conn_ent, 400,
                                        "Message processing error");
+
                        return;
                }
 
index eec25fffd81f2e2abaf7c80694b52ca7097f5e04..c085688397b285ba792bc1ae72d3b04144e2137f 100644 (file)
@@ -453,4 +453,6 @@ process_regexp_item (struct rspamd_task *task,
        if (res) {
                rspamd_task_insert_result (task, item->symbol, res, NULL);
        }
+
+       rspamd_symbols_cache_finalize_item (task, symcache_item);
 }
index 1ec30b4ee5ec48faefb8e0bfe2ceeee529055f44..eb8b6947f1c869605ef9fe5968f2d61e9a59c795 100644 (file)
@@ -594,6 +594,7 @@ spf_symbol_callback (struct rspamd_task *task,
 
        if (rspamd_match_radix_map_addr (spf_module_ctx->whitelist_ip,
                        task->from_addr) != NULL) {
+               rspamd_symbols_cache_finalize_item (task, item);
                return;
        }
 
@@ -601,6 +602,7 @@ spf_symbol_callback (struct rspamd_task *task,
                        || (!spf_module_ctx->check_local &&
                                        rspamd_inet_address_is_local (task->from_addr, TRUE))) {
                msg_info_task ("skip SPF checks for local networks and authorized users");
+               rspamd_symbols_cache_finalize_item (task, item);
                return;
        }
 
@@ -623,6 +625,7 @@ spf_symbol_callback (struct rspamd_task *task,
                                                spf_module_ctx->symbol_dnsfail,
                                                1,
                                                "(SPF): spf DNS fail");
+                               rspamd_symbols_cache_finalize_item (task, item);
                        }
                        else {
                                rspamd_symcache_item_async_inc (task, item);
index 0717b4679b32ae33cef2f8401edd4f8e4dc8f9d8..e2bf9770307cdb1e817e416691ef7b3ec2724fda 100644 (file)
@@ -1893,6 +1893,8 @@ surbl_test_url (struct rspamd_task *task,
        if (!rspamd_monitored_alive (suffix->m)) {
                msg_info_surbl ("disable surbl %s as it is reported to be offline",
                                suffix->suffix);
+               rspamd_symbols_cache_finalize_item (task, item);
+
                return;
        }