From 2679640c0f6dfc28f0e243adb3bfdf8c41cbb027 Mon Sep 17 00:00:00 2001 From: srgnk Date: Tue, 28 May 2019 21:02:07 +0200 Subject: [PATCH] fix: Don't print spurious JSON server output in bidir mode (#868) In bidirectional mode, if option --get-server-output is set and if both client and server have --json set to true, client would still print the json output of server to stdout as a separate piece instead of including it into client's json output. This patch fixes this problem, the server's json output would be appended to client's json field 'server_output_json' as it should be. --- src/iperf_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iperf_api.c b/src/iperf_api.c index 6114dc1..014a560 100755 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -3353,7 +3353,7 @@ iperf_print_results(struct iperf_test *test) } /* Print server output if we're on the client and it was requested/provided */ - if (test->role == 'c' && iperf_get_test_get_server_output(test)) { + if (test->role == 'c' && iperf_get_test_get_server_output(test) && !test->json_output) { if (test->json_server_output) { iperf_printf(test, "\nServer JSON output:\n%s\n", cJSON_Print(test->json_server_output)); cJSON_Delete(test->json_server_output);