1
1

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.
Этот коммит содержится в:
srgnk 2019-05-28 21:02:07 +02:00 коммит произвёл Bruce A. Mah
родитель 0891322aad
Коммит 2679640c0f

Просмотреть файл

@ -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);