Skip to content

Commit

Permalink
Fix/Optimize test termination condition check (esnet#1114)
Browse files Browse the repository at this point in the history
`test->done` represents the test completion.
In some modes, duration-based (-t) test, and file-transfer (-F)  in particular,
the `test->done` is set during the timeout handler or file-transfer functions.
For such configurations, and in general, `test->done` being set is sufficient
condition for terminating the test.

This commit generalizes the condition check to `test->done`,
removing the clause which limtis this condition case to duration-based test only.
  • Loading branch information
hanvari authored Feb 6, 2021
1 parent de33801 commit 4108997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iperf_client_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ iperf_run_client(struct iperf_test * test)
* being the receiver.
*/
if ((!test->omitting) &&
((test->duration != 0 && test->done) ||
(test->done ||
(test->settings->bytes != 0 && (test->bytes_sent >= test->settings->bytes ||
test->bytes_received >= test->settings->bytes)) ||
(test->settings->blocks != 0 && (test->blocks_sent >= test->settings->blocks ||
Expand Down

0 comments on commit 4108997

Please sign in to comment.