aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYun Jiang <66518086+yjiang-c@users.noreply.github.com>2020-07-07 16:01:35 +0100
committerGitHub <noreply@github.com>2020-07-07 08:01:35 -0700
commit5e7ea0bd1ef6564a06dad950e7ef99800e36957c (patch)
tree84c61df51622fe1a7d311faea5b6e619f0af65af
parent215acfe7aa643a43c13d28f6496e29b6f16f873c (diff)
downloadiperf3-5e7ea0bd1ef6564a06dad950e7ef99800e36957c.tar.gz
fix: Prevent 100% CPU usage when --bidir option is enabled. (#1011)
-rw-r--r--src/iperf_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c
index 6d91fb7..412c527 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -1480,7 +1480,8 @@ iperf_send(struct iperf_test *test, fd_set *write_setP)
if (test->settings->burst != 0) {
iperf_time_now(&now);
SLIST_FOREACH(sp, &test->streams, streams)
- iperf_check_throttle(sp, &now);
+ if (sp->sender)
+ iperf_check_throttle(sp, &now);
}
if (write_setP != NULL)
SLIST_FOREACH(sp, &test->streams, streams)
@@ -1562,7 +1563,7 @@ iperf_create_send_timers(struct iperf_test * test)
}
SLIST_FOREACH(sp, &test->streams, streams) {
sp->green_light = 1;
- if (test->settings->rate != 0) {
+ if (test->settings->rate != 0 && sp->sender) {
cd.p = sp;
sp->send_timer = tmr_create(NULL, send_timer_proc, cd, test->settings->pacing_timer, 1);
if (sp->send_timer == NULL) {