Skip to content

Commit

Permalink
Make -n / -k options work correctly.
Browse files Browse the repository at this point in the history
We need to get the threads to exit when the ending conditions
for -n / -k are reached, but we weren't doing that.

While here, clean up some not-very-often-used error case code
and pet copyright dates.

Fixes IPERF-151.
  • Loading branch information
bmah888 committed Nov 8, 2023
1 parent 30ce2d5 commit b14c3b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/iperf_client_api.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* iperf, Copyright (c) 2014-2022, The Regents of the University of
* iperf, Copyright (c) 2014-2023, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
Expand Down Expand Up @@ -56,7 +56,7 @@ iperf_client_worker_run(void *s) {
struct iperf_stream *sp = (struct iperf_stream *) s;
struct iperf_test *test = sp->test;

while (! (test->done)) {
while (! (test->done) && ! (sp->done)) {
if (sp->sender) {
if (iperf_send_mt(sp) < 0) {
goto cleanup_and_fail;
Expand All @@ -71,8 +71,6 @@ iperf_client_worker_run(void *s) {
return NULL;

cleanup_and_fail:
/* XXX */
test->done = 0;
return NULL;
}

Expand Down
6 changes: 2 additions & 4 deletions src/iperf_server_api.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* iperf, Copyright (c) 2014-2022 The Regents of the University of
* iperf, Copyright (c) 2014-2023 The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
Expand Down Expand Up @@ -71,7 +71,7 @@ iperf_server_worker_run(void *s) {
struct iperf_stream *sp = (struct iperf_stream *) s;
struct iperf_test *test = sp->test;

while (! (test->done)) {
while (! (test->done) && ! (sp->done)) {
if (sp->sender) {
if (iperf_send_mt(sp) < 0) {
goto cleanup_and_fail;
Expand All @@ -86,8 +86,6 @@ iperf_server_worker_run(void *s) {
return NULL;

cleanup_and_fail:
/* XXX */
test->done = 0;
return NULL;
}

Expand Down

0 comments on commit b14c3b9

Please sign in to comment.