aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/protocol.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 16:38:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 16:38:18 +0100
commit1018b509c8a9d2c0b48fc34510b6a32095733959 (patch)
treeadc1423c169e95e97915c147d73dacfe1bce56d2 /src/libserver/protocol.c
parent117c578d05b9a7183513d93fb8a82e6493589f77 (diff)
downloadrspamd-1018b509c8a9d2c0b48fc34510b6a32095733959.tar.gz
rspamd-1018b509c8a9d2c0b48fc34510b6a32095733959.zip
Add pre-result as `reason` key for the output.
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r--src/libserver/protocol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 56f29071c..9ecb3c642 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -790,6 +790,7 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg,
rspamd_http_message_add_header (msg, hn->str, hv->str);
}
+
g_hash_table_iter_init (&hiter, task->results);
top = ucl_object_typed_new (UCL_OBJECT);
@@ -800,6 +801,11 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg,
ucl_object_insert_key (top, obj, h, 0, false);
}
+ if (task->pre_result.str != NULL) {
+ ucl_object_insert_key (top, ucl_object_fromstring (task->pre_result.str),
+ "reason", 0, false);
+ }
+
if (task->messages != NULL) {
ucl_object_insert_key (top, rspamd_str_list_ucl (
task->messages), "messages", 0, false);