esnet / esnet/iperf

Invalid JSON output for buffer information

Open
#856 6 comments 2 reactions 0 assignees View on GitHub
bug bug:json
Dominant language
C
Stars
8.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

_NOTE: The iperf3 issue tracker is for registering bugs, enhancement
requests, or submissions of code. It is not a means for asking
questions about building or using iperf3. Those are best directed
towards the iperf3 mailing list at iperf-dev@google-groups.com or
question sites such as Stack Overflow
(http://www.stackoverflow.com/). A list of frequently-asked questions
regarding iperf3 can be found at http://software.es.net/iperf/faq.html._

# Context

* Version of iperf3:
3.6+

* Hardware:

* Operating system (and distribution, if any):

_Please note: iperf3 is supported on Linux, FreeBSD, and macOS.
Support may be provided on a best-effort basis to other UNIX-like
platforms. We cannot provide support for building and/or running
iperf3 on Windows, iOS, or Android._

* Other relevant information (for example, non-default compilers,
libraries, cross-compiling, etc.):

_Please fill out one of the "Bug Report" or "Enhancement Request"
sections, as appropriate._

# Bug Report

* Expected Behavior
Valid JSON output using -u and -P options.

* Actual Behavior
Invalid JSON output using -u and -P options.

* Steps to Reproduce
Invoke iperf3 with -u, -P and --json options

* Possible Solution
Current code outputs JSON for sock_bufsize, sndbuf_actual, and rcvbuf_actual values in iperf_udp_buffercheck(), however this may be called multiple times even for a single stream, and definitely will be called multiple times if the -P option is specified, but the JSON is not encapsulated within an array.

1) Declare and create JSON array to hold buffer information e.g. json_buffers and add array to test->json_start
2) Use cJSON_AddItemToArray() in iperf_udp_connect() *after* calls to iperf_udp_buffercheck() to add buffer items.

_Please submit patches or code changes as a pull request._

# Enhancement Request

* Current behavior

* Desired behavior

* Implementation notes

_If submitting a proposed implementation of an enhancement request,
please use the pull request mechanism._

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.