Merge branch https://github.com/candlerb/iperf/tree/candlerb-multisend in #232 to master
* candlerb-candlerb-multisend: Drop out of multisend loop if none of the streams are accepting data
This commit is contained in:
commit
59e1c29f49
@ -1002,7 +1002,7 @@ iperf_check_throttle(struct iperf_stream *sp, struct timeval *nowP)
|
||||
int
|
||||
iperf_send(struct iperf_test *test, fd_set *write_setP)
|
||||
{
|
||||
register int multisend, r;
|
||||
register int multisend, r, streams_active;
|
||||
register struct iperf_stream *sp;
|
||||
struct timeval now;
|
||||
|
||||
@ -1017,6 +1017,7 @@ iperf_send(struct iperf_test *test, fd_set *write_setP)
|
||||
for (; multisend > 0; --multisend) {
|
||||
if (test->settings->rate != 0 && test->settings->burst == 0)
|
||||
gettimeofday(&now, NULL);
|
||||
streams_active = 0;
|
||||
SLIST_FOREACH(sp, &test->streams, streams) {
|
||||
if (sp->green_light &&
|
||||
(write_setP == NULL || FD_ISSET(sp->socket, write_setP))) {
|
||||
@ -1026,6 +1027,7 @@ iperf_send(struct iperf_test *test, fd_set *write_setP)
|
||||
i_errno = IESTREAMWRITE;
|
||||
return r;
|
||||
}
|
||||
streams_active = 1;
|
||||
test->bytes_sent += r;
|
||||
++test->blocks_sent;
|
||||
if (test->settings->rate != 0 && test->settings->burst == 0)
|
||||
@ -1036,6 +1038,8 @@ iperf_send(struct iperf_test *test, fd_set *write_setP)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!streams_active)
|
||||
break;
|
||||
}
|
||||
if (test->settings->burst != 0) {
|
||||
gettimeofday(&now, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user