From: Vsevolod Stakhov Date: Mon, 7 Sep 2015 20:27:45 +0000 (+0100) Subject: Display json output if even cannot parse it if `--json` is on. X-Git-Tag: 1.0.0~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=026ef9f258bce99f60c2547ee82f670f040d1983;p=thirdparty%2Frspamd.git Display json output if even cannot parse it if `--json` is on. --- diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 7d523e7376..6648aef215 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -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");