aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/rspamc.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-06 08:10:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-06 08:10:15 +0100
commitea29e13da575a17d427e2f773bc9907005599ab1 (patch)
tree9bfb440bf22fb39f65c51649cabb5cb5e314b7c4 /src/client/rspamc.c
parent26e7294bf52f3b74dfad5c4bd27fb77d26c2e7d0 (diff)
downloadrspamd-ea29e13da575a17d427e2f773bc9907005599ab1.tar.gz
rspamd-ea29e13da575a17d427e2f773bc9907005599ab1.zip
[Minor] Inject filename and scan time to json output
Diffstat (limited to 'src/client/rspamc.c')
-rw-r--r--src/client/rspamc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index b8865b9c1..bd199fda3 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -1522,6 +1522,18 @@ rspamc_client_cb (struct rspamd_client_connection *conn,
rspamc_output_headers (out, msg);
}
if (raw || cmd->command_output_func == NULL) {
+ if (cmd->need_input) {
+ ucl_object_insert_key (result,
+ ucl_object_fromstring (cbdata->filename),
+ "filename", 0,
+ false);
+ }
+
+ ucl_object_insert_key (result,
+ ucl_object_fromdouble (diff),
+ "scan_time", 0,
+ false);
+
if (json) {
ucl_out = ucl_object_emit (result,
compact ? UCL_EMIT_JSON_COMPACT : UCL_EMIT_JSON);
@@ -1530,6 +1542,7 @@ rspamc_client_cb (struct rspamd_client_connection *conn,
ucl_out = ucl_object_emit (result,
compact ? UCL_EMIT_JSON_COMPACT : UCL_EMIT_CONFIG);
}
+
rspamd_fprintf (out, "%s", ucl_out);
free (ucl_out);
}