From ff3c7fba24bcb1be225ac2e30c453ecd0fa74d5e Mon Sep 17 00:00:00 2001 From: jef Date: Sat, 27 Oct 2012 16:24:54 -0700 Subject: [PATCH] JSON names are case-insensitive so we have to use different names for e.g. p and P. I prefixed the upper case flags with "cap". --- src/iperf_api.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/iperf_api.c b/src/iperf_api.c index eeed087..c9d0ec3 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -773,10 +773,10 @@ send_parameters(struct iperf_test *test) if (test->settings->mss) cJSON_AddIntToObject(j, "m", test->settings->mss); if (test->no_delay) - cJSON_AddTrueToObject(j, "N"); - cJSON_AddIntToObject(j, "P", test->num_streams); + cJSON_AddTrueToObject(j, "capN"); + cJSON_AddIntToObject(j, "capP", test->num_streams); if (test->reverse) - cJSON_AddTrueToObject(j, "R"); + cJSON_AddTrueToObject(j, "capR"); if (test->settings->socket_bufsize) cJSON_AddIntToObject(j, "w", test->settings->socket_bufsize); if (test->settings->blksize) @@ -784,7 +784,7 @@ send_parameters(struct iperf_test *test) if (test->settings->rate) cJSON_AddIntToObject(j, "b", test->settings->rate); if (test->settings->tos) - cJSON_AddIntToObject(j, "S", test->settings->tos); + cJSON_AddIntToObject(j, "capS", test->settings->tos); if (JSON_write(test->ctrl_sck, j) < 0) { i_errno = IESENDPARAMS; r = -1; @@ -818,11 +818,11 @@ get_parameters(struct iperf_test *test) test->settings->bytes = j_p->valueint; if ((j_p = cJSON_GetObjectItem(j, "m")) != NULL) test->settings->mss = j_p->valueint; - if ((j_p = cJSON_GetObjectItem(j, "N")) != NULL) + if ((j_p = cJSON_GetObjectItem(j, "capN")) != NULL) test->no_delay = 1; - if ((j_p = cJSON_GetObjectItem(j, "P")) != NULL) + if ((j_p = cJSON_GetObjectItem(j, "capP")) != NULL) test->num_streams = j_p->valueint; - if ((j_p = cJSON_GetObjectItem(j, "R")) != NULL) + if ((j_p = cJSON_GetObjectItem(j, "capR")) != NULL) test->reverse = 1; if ((j_p = cJSON_GetObjectItem(j, "w")) != NULL) test->settings->socket_bufsize = j_p->valueint; @@ -830,7 +830,7 @@ get_parameters(struct iperf_test *test) test->settings->blksize = j_p->valueint; if ((j_p = cJSON_GetObjectItem(j, "b")) != NULL) test->settings->rate = j_p->valueint; - if ((j_p = cJSON_GetObjectItem(j, "S")) != NULL) + if ((j_p = cJSON_GetObjectItem(j, "capS")) != NULL) test->settings->tos = j_p->valueint; cJSON_Delete(j); }