diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-19 07:43:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-19 07:43:21 +0000 |
commit | 404dfe01888353e3e475231c0e4d77eda2eb2d7b (patch) | |
tree | 3e5217ce59b8ec49ad2cf218f0f21c330c236816 /src | |
parent | b1cd84b44052098e033481bba6723ade9438e5ed (diff) | |
download | rspamd-404dfe01888353e3e475231c0e4d77eda2eb2d7b.tar.gz rspamd-404dfe01888353e3e475231c0e4d77eda2eb2d7b.zip |
[Fix] Apply language detection when adding fuzzy hashes
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 1 | ||||
-rw-r--r-- | src/libserver/worker_util.h | 2 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 2 |
3 files changed, 4 insertions, 1 deletions
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)); |