diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-27 17:33:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-27 17:33:56 +0100 |
commit | 6e00dea760aca106de1021e5a9740b9511a6e0b2 (patch) | |
tree | dc5f5a67564d419f67ae03e63db45c8b81b822be /src/plugins | |
parent | ce9a26d98932473c449e5d4bf39dbb93a6d7a924 (diff) | |
download | rspamd-6e00dea760aca106de1021e5a9740b9511a6e0b2.tar.gz rspamd-6e00dea760aca106de1021e5a9740b9511a6e0b2.zip |
Refactor and unify function names.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/chartable.c | 2 | ||||
-rw-r--r-- | src/plugins/dkim_check.c | 6 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 6 | ||||
-rw-r--r-- | src/plugins/regexp.c | 4 | ||||
-rw-r--r-- | src/plugins/spf.c | 8 | ||||
-rw-r--r-- | src/plugins/surbl.c | 10 |
6 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 7c4372a13..cbf23c336 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -100,7 +100,7 @@ chartable_module_config (struct rspamd_config *cfg) chartable_module_ctx->threshold = DEFAULT_THRESHOLD; } - register_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_normal (cfg->cache, chartable_module_ctx->symbol, 1, chartable_symbol_callback, diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index 7e430f5a6..9a7fc3323 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -223,15 +223,15 @@ dkim_module_config (struct rspamd_config *cfg) "trusted_only option is set and no trusted domains are defined; disabling dkim module completely as it is useless in this case"); } else { - register_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_normal (cfg->cache, dkim_module_ctx->symbol_reject, 1, dkim_symbol_callback, NULL); - register_virtual_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, dkim_module_ctx->symbol_tempfail, 1); - register_virtual_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, dkim_module_ctx->symbol_allow, 1); diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index c1556fa4d..8233fb43b 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -174,7 +174,7 @@ parse_flags (struct fuzzy_rule *rule, /* Add flag to hash table */ g_hash_table_insert (rule->mappings, GINT_TO_POINTER (map->fuzzy_flag), map); - register_virtual_symbol (cfg->cache, map->symbol, 1.0); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, map->symbol, 1.0); } else { msg_err ("fuzzy_map parameter has no flag definition"); @@ -383,7 +383,7 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj) fuzzy_module_ctx->fuzzy_rules, rule); if (rule->symbol != fuzzy_module_ctx->default_symbol) { - register_virtual_symbol (cfg->cache, rule->symbol, 1.0); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, rule->symbol, 1.0); } } @@ -484,7 +484,7 @@ fuzzy_check_module_config (struct rspamd_config *cfg) } if (fuzzy_module_ctx->fuzzy_rules != NULL) { - register_callback_symbol (cfg->cache, fuzzy_module_ctx->default_symbol, + rspamd_symbols_cache_add_symbol_callback (cfg->cache, fuzzy_module_ctx->default_symbol, 1.0, fuzzy_symbol_callback, NULL); } else { diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 2a9229b09..da2caab4a 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -142,7 +142,7 @@ regexp_module_config (struct rspamd_config *cfg) res = FALSE; } else { - register_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_normal (cfg->cache, cur_item->symbol, 1, process_regexp_item, @@ -154,7 +154,7 @@ regexp_module_config (struct rspamd_config *cfg) sizeof (struct regexp_module_item)); cur_item->symbol = ucl_object_key (value); cur_item->lua_function = ucl_object_toclosure (value); - register_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_normal (cfg->cache, cur_item->symbol, 1, process_regexp_item, diff --git a/src/plugins/spf.c b/src/plugins/spf.c index f3c8226e4..8c477cca9 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -151,14 +151,14 @@ spf_module_config (struct rspamd_config *cfg) } } - register_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_normal (cfg->cache, spf_module_ctx->symbol_fail, 1, spf_symbol_callback, NULL); - register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_softfail, 1); - register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_neutral, 1); - register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_allow, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, spf_module_ctx->symbol_softfail, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, spf_module_ctx->symbol_neutral, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, spf_module_ctx->symbol_allow, 1); spf_module_ctx->spf_hash = rspamd_lru_hash_new ( cache_size, diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index bd87dc944..48b0bba32 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -314,18 +314,18 @@ register_bit_symbols (struct rspamd_config *cfg, struct suffix_item *suffix) while (g_hash_table_iter_next (&it, &k, &v)) { bit = v; - register_virtual_symbol (cfg->cache, bit->symbol, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, bit->symbol, 1); msg_debug ("bit: %d", bit->bit); } } else if (suffix->bits != NULL) { for (i = 0; i < suffix->bits->len; i++) { bit = &g_array_index (suffix->bits, struct surbl_bit_item, i); - register_virtual_symbol (cfg->cache, bit->symbol, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, bit->symbol, 1); } } else { - register_virtual_symbol (cfg->cache, suffix->symbol, 1); + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, suffix->symbol, 1); } } @@ -361,7 +361,7 @@ surbl_module_config (struct rspamd_config *cfg) rspamd_config_get_module_opt (cfg, "surbl", "redirector_symbol")) != NULL) { surbl_module_ctx->redirector_symbol = ucl_obj_tostring (value); - register_virtual_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_virtual (cfg->cache, surbl_module_ctx->redirector_symbol, 1.0); } @@ -553,7 +553,7 @@ surbl_module_config (struct rspamd_config *cfg) surbl_module_ctx->suffixes = g_list_prepend ( surbl_module_ctx->suffixes, new_suffix); - register_callback_symbol (cfg->cache, + rspamd_symbols_cache_add_symbol_callback (cfg->cache, new_suffix->symbol, 1, surbl_test_url, |