diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-24 12:15:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-24 12:15:48 +0100 |
commit | c36baca06837867a85b57748e334f660708941d5 (patch) | |
tree | 0cbb9649fb6341d56d3f806b77343083ffe45f17 /src | |
parent | 450d9a55450167db09f61139ee8086756839391d (diff) | |
download | rspamd-c36baca06837867a85b57748e334f660708941d5.tar.gz rspamd-c36baca06837867a85b57748e334f660708941d5.zip |
[Fix] Support v2 checks in controller
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/controller.c b/src/controller.c index 18b81d30e..591c21b4c 100644 --- a/src/controller.c +++ b/src/controller.c @@ -53,6 +53,7 @@ #define PATH_SAVE_MAP "/savemap" #define PATH_SCAN "/scan" #define PATH_CHECK "/check" +#define PATH_CHECKV2 "/checkv2" #define PATH_STAT "/stat" #define PATH_STAT_RESET "/statreset" #define PATH_COUNTERS "/counters" @@ -2055,6 +2056,19 @@ rspamd_controller_handle_scan (struct rspamd_http_connection_entry *conn_ent, task->flags |= RSPAMD_TASK_FLAG_MIME; task->resolver = ctx->resolver; + if (!rspamd_protocol_handle_request (task, msg)) { + if (task->err) { + rspamd_controller_send_error (conn_ent, task->err->code, "%s", + task->err->message); + } + else { + rspamd_controller_send_error (conn_ent, 500, + "Message load error: unknown error"); + } + rspamd_session_destroy (task->s); + return 0; + } + if (!rspamd_task_load_message (task, msg, msg->body_buf.begin, msg->body_buf.len)) { if (task->err) { rspamd_controller_send_error (conn_ent, task->err->code, "%s", @@ -3676,6 +3690,9 @@ start_controller_worker (struct rspamd_worker *worker) PATH_CHECK, rspamd_controller_handle_scan); rspamd_http_router_add_path (ctx->http, + PATH_CHECKV2, + rspamd_controller_handle_scan); + rspamd_http_router_add_path (ctx->http, PATH_STAT, rspamd_controller_handle_stat); rspamd_http_router_add_path (ctx->http, |