Fix issue 692 (#705)
Don't count data for tests received after the end of a test. This prevents is from reporting an incorrect number of bytes received at the end of the test, which doesn't match up with the sum of the data received during the test intervals. Log late receives if debugging mode enabled. Fixes #692.
Этот коммит содержится в:
родитель
8740c8cf8e
Коммит
c0055199b5
@ -63,8 +63,15 @@ iperf_sctp_recv(struct iperf_stream *sp)
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* Only count bytes received while we're in the correct state. */
|
||||||
|
if (sp->test->state == TEST_RUNNING) {
|
||||||
sp->result->bytes_received += r;
|
sp->result->bytes_received += r;
|
||||||
sp->result->bytes_received_this_interval += r;
|
sp->result->bytes_received_this_interval += r;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (sp->test->debug)
|
||||||
|
printf("Late receive, state = %d\n", sp->test->state);
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
#else
|
#else
|
||||||
|
@ -60,8 +60,15 @@ iperf_tcp_recv(struct iperf_stream *sp)
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* Only count bytes received while we're in the correct state. */
|
||||||
|
if (sp->test->state == TEST_RUNNING) {
|
||||||
sp->result->bytes_received += r;
|
sp->result->bytes_received += r;
|
||||||
sp->result->bytes_received_this_interval += r;
|
sp->result->bytes_received_this_interval += r;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (sp->test->debug)
|
||||||
|
printf("Late receive, state = %d\n", sp->test->state);
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* iperf, Copyright (c) 2014, 2016, 2017, The Regents of the University of
|
* iperf, Copyright (c) 2014-2018, The Regents of the University of
|
||||||
* California, through Lawrence Berkeley National Laboratory (subject
|
* California, through Lawrence Berkeley National Laboratory (subject
|
||||||
* to receipt of any required approvals from the U.S. Dept. of
|
* to receipt of any required approvals from the U.S. Dept. of
|
||||||
* Energy). All rights reserved.
|
* Energy). All rights reserved.
|
||||||
@ -78,6 +78,8 @@ iperf_udp_recv(struct iperf_stream *sp)
|
|||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* Only count bytes received while we're in the correct state. */
|
||||||
|
if (sp->test->state == TEST_RUNNING) {
|
||||||
sp->result->bytes_received += r;
|
sp->result->bytes_received += r;
|
||||||
sp->result->bytes_received_this_interval += r;
|
sp->result->bytes_received_this_interval += r;
|
||||||
|
|
||||||
@ -169,6 +171,11 @@ iperf_udp_recv(struct iperf_stream *sp)
|
|||||||
d = -d;
|
d = -d;
|
||||||
sp->prev_transit = transit;
|
sp->prev_transit = transit;
|
||||||
sp->jitter += (d - sp->jitter) / 16.0;
|
sp->jitter += (d - sp->jitter) / 16.0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (sp->test->debug)
|
||||||
|
printf("Late receive, state = %d\n", sp->test->state);
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user