]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Display json output if even cannot parse it if `--json` is on.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 7 Sep 2015 20:27:45 +0000 (21:27 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 7 Sep 2015 20:27:45 +0000 (21:27 +0100)
src/client/rspamc.c

index 7d523e7376764d4e198a47da0b0ac56bcc6b31c9..6648aef215e7f4bdd15bc4c83806ea63074a7296 100644 (file)
@@ -1077,6 +1077,11 @@ rspamc_client_cb (struct rspamd_client_connection *conn,
                }
                else if (err != NULL) {
                        rspamd_fprintf (out, "%s\n", err->message);
+
+                       if (json && msg != NULL && msg->body != NULL) {
+                               /* We can also output the resulting json */
+                               rspamd_fprintf (out, "%v\n", msg->body);
+                       }
                }
 
                rspamd_fprintf (out, "\n");