From 404dfe01888353e3e475231c0e4d77eda2eb2d7b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 19 Jan 2018 07:43:21 +0000 Subject: [Fix] Apply language detection when adding fuzzy hashes --- src/controller.c | 1 + src/libserver/worker_util.h | 2 ++ src/plugins/fuzzy_check.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/controller.c b/src/controller.c index 1367c819b..b1eb5a352 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3018,6 +3018,7 @@ rspamd_controller_accept_socket (gint fd, short what, void *arg) "csession"); session->ctx = ctx; session->cfg = ctx->cfg; + session->lang_det = ctx->lang_det; REF_RETAIN (session->cfg); session->from_addr = addr; diff --git a/src/libserver/worker_util.h b/src/libserver/worker_util.h index 3af9c961d..9e99a99a5 100644 --- a/src/libserver/worker_util.h +++ b/src/libserver/worker_util.h @@ -77,6 +77,7 @@ struct rspamd_custom_controller_command { }; struct rspamd_controller_worker_ctx; +struct rspamd_lang_detector; struct rspamd_controller_session { struct rspamd_controller_worker_ctx *ctx; @@ -86,6 +87,7 @@ struct rspamd_controller_session { gchar *classifier; rspamd_inet_addr_t *from_addr; struct rspamd_config *cfg; + struct rspamd_lang_detector *lang_det; gboolean is_spam; gboolean is_enable; }; diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index a5e6487c1..02e870190 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2959,7 +2959,7 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent, gint r, *saved, rules = 0, err_idx; /* Prepare task */ - task = rspamd_task_new (session->wrk, session->cfg, NULL, NULL); + task = rspamd_task_new (session->wrk, session->cfg, NULL, session->lang_det); task->cfg = ctx->cfg; task->ev_base = conn_ent->rt->ev_base; saved = rspamd_mempool_alloc0 (session->pool, sizeof (gint)); -- cgit v1.2.3