aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 17:00:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 17:00:11 +0100
commitf03be93115d30c13b3fcf43fb53fa3872600c1f8 (patch)
treea58288fdfd3f596da6e4bc342f76801568e06e32
parentc132cd323144a4977d2df16b4d180008663a88cd (diff)
downloadrspamd-f03be93115d30c13b3fcf43fb53fa3872600c1f8.tar.gz
rspamd-f03be93115d30c13b3fcf43fb53fa3872600c1f8.zip
Show messages in rspamc.
-rw-r--r--src/client/rspamc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index 74f5ae111..3107c74f4 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -474,8 +474,8 @@ rspamc_metric_output (const ucl_object_t *obj)
static void
rspamc_symbols_output (ucl_object_t *obj)
{
- ucl_object_iter_t it = NULL;
- const ucl_object_t *cur;
+ ucl_object_iter_t it = NULL, mit = NULL;
+ const ucl_object_t *cur, *cmesg;
gchar *emitted;
while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
@@ -501,9 +501,14 @@ rspamc_symbols_output (ucl_object_t *obj)
rspamd_fprintf (stdout, "Scan error: %s\n", ucl_object_tostring (
cur));
}
- else if (g_ascii_strcasecmp (ucl_object_key (cur), "reason") == 0) {
- rspamd_fprintf (stdout, "Reason: %s\n", ucl_object_tostring (
- cur));
+ else if (g_ascii_strcasecmp (ucl_object_key (cur), "messages") == 0) {
+ if (cur->type == UCL_ARRAY) {
+ mit = NULL;
+ while ((cmesg = ucl_iterate_object (cur, &mit, true)) != NULL) {
+ rspamd_fprintf (stdout, "Message: %s\n",
+ ucl_object_tostring (cmesg));
+ }
+ }
}
else if (cur->type == UCL_OBJECT) {
/* Parse metric */