]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Allow autolearn for the controller worker
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 18 May 2024 11:56:01 +0000 (12:56 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 18 May 2024 11:57:16 +0000 (12:57 +0100)
src/libserver/task.c
src/rspamd_proxy.c
src/worker.c

index 270bb80ea42177a6834b8b880113ec225ab1c23e..6b349d3599df7cd5b2a595df155c955b3175ab89 100644 (file)
@@ -70,7 +70,7 @@ rspamd_task_new(struct rspamd_worker *worker,
 {
        struct rspamd_task *new_task;
        rspamd_mempool_t *task_pool;
-       unsigned int flags = 0;
+       unsigned int flags = RSPAMD_TASK_FLAG_LEARN_AUTO;
 
        if (pool == NULL) {
                task_pool = rspamd_mempool_new(rspamd_mempool_suggest_size(),
index 415d22f07805bfd6e1f27bb77eefdabd01614aba..5bf1fb8f2da880d11d4605d4f260d6493b3e4ec9 100644 (file)
@@ -1887,8 +1887,6 @@ rspamd_proxy_self_scan(struct rspamd_proxy_session *session)
 
        task->fin_arg = session;
        task->resolver = session->ctx->resolver;
-       /* TODO: allow to disable autolearn in protocol */
-       task->flags |= RSPAMD_TASK_FLAG_LEARN_AUTO;
        task->s = rspamd_session_create(task->task_pool, rspamd_proxy_task_fin,
                                                                        NULL, (event_finalizer_t) rspamd_task_free, task);
        data = rspamd_http_message_get_body(msg, &len);
index 9bf27b26087993497b123020ba606aa3346210e0..150f813c97904cd5868863ae98a98bc9336a2703 100644 (file)
@@ -152,8 +152,6 @@ rspamd_worker_body_handler(struct rspamd_http_connection *conn,
        task->http_conn = session->http_conn;
 
        task->resolver = ctx->resolver;
-       /* TODO: allow to disable autolearn in protocol */
-       task->flags |= RSPAMD_TASK_FLAG_LEARN_AUTO;
 
        session->worker->nconns++;
        rspamd_mempool_add_destructor(task->task_pool,