This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit b9ad64627d48e3e85cfab2664d67087f9c273995
Author: YAMAMOTO Takashi <[email protected]>
AuthorDate: Thu Jun 10 13:34:46 2021 +0900

    iperf: accept -t 0, meaning forever
---
 netutils/iperf/iperf.c      | 2 +-
 netutils/iperf/iperf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c
index 2cc4853..58efbcf 100644
--- a/netutils/iperf/iperf.c
+++ b/netutils/iperf/iperf.c
@@ -264,7 +264,7 @@ static void iperf_report_task(void *arg)
              now_len,
              (((double)(now_len - last_len) * 8) /
              ts_diff(&now, &last) / 1e6));
-      if (ts_diff(&now, &start) >= time)
+      if (time != 0 && ts_diff(&now, &start) >= time)
         {
           break;
         }
diff --git a/netutils/iperf/iperf_main.c b/netutils/iperf/iperf_main.c
index 39e8cfc..e31d799 100644
--- a/netutils/iperf/iperf_main.c
+++ b/netutils/iperf/iperf_main.c
@@ -209,7 +209,7 @@ int main(int argc, FAR char *argv[])
   else
     {
       cfg.time = iperf_args.time->ival[0];
-      if (cfg.time <= cfg.interval)
+      if (cfg.time != 0 && cfg.time <= cfg.interval)
         {
           cfg.time = cfg.interval;
         }

Reply via email to