Browse Source

[Fix] Fix finalization for internal plugins

tags/1.8.2
Vsevolod Stakhov 5 years ago
parent
commit
a7d6560cfb
5 changed files with 19 additions and 0 deletions
  1. 3
    0
      src/plugins/dkim_check.c
  2. 9
    0
      src/plugins/fuzzy_check.c
  3. 2
    0
      src/plugins/regexp.c
  4. 3
    0
      src/plugins/spf.c
  5. 2
    0
      src/plugins/surbl.c

+ 3
- 0
src/plugins/dkim_check.c View 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

+ 9
- 0
src/plugins/fuzzy_check.c View 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;
}


+ 2
- 0
src/plugins/regexp.c View 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);
}

+ 3
- 0
src/plugins/spf.c View 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);

+ 2
- 0
src/plugins/surbl.c View 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;
}


Loading…
Cancel
Save