aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrgnk <sergey.n.nemov@gmail.com>2019-05-28 21:02:07 +0200
committerBruce A. Mah <bmah@es.net>2019-05-28 12:02:07 -0700
commit2679640c0f6dfc28f0e243adb3bfdf8c41cbb027 (patch)
treed6e30b951e32b021e3efbb987f1babf0c3dd7fcf
parent0891322aad75c2a296ed0ac41f89baf4a3e438bd (diff)
downloadiperf3-2679640c0f6dfc28f0e243adb3bfdf8c41cbb027.tar.gz
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.
-rwxr-xr-xsrc/iperf_api.c2
1 files changed, 1 insertions, 1 deletions
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);