diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-20 12:39:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-20 19:43:32 +0100 |
commit | 62828baf0ec2364a561aba3bf5894c4dcca7cc41 (patch) | |
tree | 2dbce172d5491df3220251ae9934b356dc22bf7b /src/plugins | |
parent | 97a9de385402020d3add12517c7bccae93af593b (diff) | |
download | rspamd-62828baf0ec2364a561aba3bf5894c4dcca7cc41.tar.gz rspamd-62828baf0ec2364a561aba3bf5894c4dcca7cc41.zip |
[Project] Pass cache item to the callback functions
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/chartable.c | 16 | ||||
-rw-r--r-- | src/plugins/dkim_check.c | 16 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 8 | ||||
-rw-r--r-- | src/plugins/regexp.c | 8 | ||||
-rw-r--r-- | src/plugins/spf.c | 8 | ||||
-rw-r--r-- | src/plugins/surbl.c | 16 |
6 files changed, 54 insertions, 18 deletions
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 414647153..45b6ff4cf 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -85,8 +85,12 @@ chartable_get_context (struct rspamd_config *cfg) chartable_module.ctx_offset); } -static void chartable_symbol_callback (struct rspamd_task *task, void *unused); -static void chartable_url_symbol_callback (struct rspamd_task *task, void *unused); +static void chartable_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); +static void chartable_url_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); gint chartable_module_init (struct rspamd_config *cfg, struct module_ctx **ctx) @@ -602,7 +606,9 @@ rspamd_chartable_process_part (struct rspamd_task *task, } static void -chartable_symbol_callback (struct rspamd_task *task, void *unused) +chartable_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { guint i; struct rspamd_mime_text_part *part; @@ -664,7 +670,9 @@ chartable_symbol_callback (struct rspamd_task *task, void *unused) } static void -chartable_url_symbol_callback (struct rspamd_task *task, void *unused) +chartable_url_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { struct rspamd_url *u; GHashTableIter it; diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index 1784612f0..945b92e04 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -90,8 +90,12 @@ struct dkim_check_result { struct dkim_check_result *next, *prev, *first; }; -static void dkim_symbol_callback (struct rspamd_task *task, void *unused); -static void dkim_sign_callback (struct rspamd_task *task, void *unused); +static void dkim_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); +static void dkim_sign_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); static gint lua_dkim_sign_handler (lua_State *L); static gint lua_dkim_verify_handler (lua_State *L); @@ -1080,7 +1084,9 @@ dkim_module_key_handler (rspamd_dkim_key_t *key, } static void -dkim_symbol_callback (struct rspamd_task *task, void *unused) +dkim_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { GPtrArray *hlist; rspamd_dkim_context_t *ctx; @@ -1232,7 +1238,9 @@ dkim_symbol_callback (struct rspamd_task *task, void *unused) } static void -dkim_sign_callback (struct rspamd_task *task, void *unused) +dkim_sign_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { lua_State *L; struct rspamd_task **ptask; diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index c43099071..a76f7d1e8 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -175,7 +175,9 @@ struct fuzzy_cmd_io { static const char *default_headers = "Subject,Content-Type,Reply-To,X-Mailer"; -static void fuzzy_symbol_callback (struct rspamd_task *task, void *unused); +static void fuzzy_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); /* Initialization */ gint fuzzy_check_module_init (struct rspamd_config *cfg, @@ -2879,7 +2881,9 @@ register_fuzzy_client_call (struct rspamd_task *task, /* This callback is called when we check message in fuzzy hashes storage */ static void -fuzzy_symbol_callback (struct rspamd_task *task, void *unused) +fuzzy_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { struct fuzzy_rule *rule; guint i; diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 92cccc338..eec25fffd 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -39,7 +39,9 @@ struct regexp_ctx { gsize max_size; }; -static void process_regexp_item (struct rspamd_task *task, void *user_data); +static void process_regexp_item (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *user_data); /* Initialization */ @@ -415,7 +417,9 @@ rspamd_lua_call_expression_func (struct ucl_lua_funcdata *lua_data, static void -process_regexp_item (struct rspamd_task *task, void *user_data) +process_regexp_item (struct rspamd_task *task, + struct rspamd_symcache_item *symcache_item, + void *user_data) { struct regexp_module_item *item = user_data; gint res = FALSE; diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 46160878f..cb4546f83 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -62,7 +62,9 @@ struct spf_ctx { gboolean check_authed; }; -static void spf_symbol_callback (struct rspamd_task *task, void *unused); +static void spf_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused); /* Initialization */ gint spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx); @@ -565,7 +567,9 @@ spf_plugin_callback (struct spf_resolved *record, struct rspamd_task *task, static void -spf_symbol_callback (struct rspamd_task *task, void *unused) +spf_symbol_callback (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *unused) { const gchar *domain; struct spf_resolved *l; diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index c27e5c858..fa4b92162 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -136,8 +136,12 @@ static const guint64 rspamd_surbl_cb_magic = 0xe09b8536f80de0d1ULL; static const gchar *rspamd_surbl_default_monitored = "facebook.com"; static const guint default_max_redirected_urls = 10; -static void surbl_test_url (struct rspamd_task *task, void *user_data); -static void surbl_test_redirector (struct rspamd_task *task, void *user_data); +static void surbl_test_url (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *user_data); +static void surbl_test_redirector (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *user_data); static void surbl_dns_callback (struct rdns_reply *reply, gpointer arg); static void surbl_dns_ip_callback (struct rdns_reply *reply, gpointer arg); static void process_dns_results (struct rspamd_task *task, @@ -1870,7 +1874,9 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) } static void -surbl_test_url (struct rspamd_task *task, void *user_data) +surbl_test_url (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *user_data) { struct redirector_param *param; struct suffix_item *suffix = user_data; @@ -1943,7 +1949,9 @@ surbl_test_url (struct rspamd_task *task, void *user_data) } static void -surbl_test_redirector (struct rspamd_task *task, void *user_data) +surbl_test_redirector (struct rspamd_task *task, + struct rspamd_symcache_item *item, + void *user_data) { struct redirector_param *param; guint i, j; |