1
1

Fix NaN in summaries with a client talking to an iperf 3.1/3.0 server.

Recent code changes require the server to send the start and end
timestamps for a test, so that the client can accurately compute
statistics for the sender side of a test.  iperf 3.1 and 3.0
servers won't do this, so if this information isn't passed back
in the results at the end of a test, we fall back to using the
client's timestamps.  The results might not match what's displayed
on the server, but this is basically what iperf 3.1 and earlier
did anyway.

Fixes #574.
Этот коммит содержится в:
Bruce A. Mah 2017-05-11 11:40:14 -07:00
родитель cab5dba86c
Коммит c71712875a

Просмотреть файл

@ -2588,14 +2588,26 @@ iperf_print_results(struct iperf_test *test)
* we were running the tests and print out some statistics about
* the streams. It's possible to not have any streams at all
* if the client got interrupted before it got to do anything.
*
* Also note that we try to keep seperate values for the sender
* and receiver ending times. Earlier iperf (3.1 and earlier)
* servers didn't send that to the clients, so in this case we fall
* back to using the client's ending timestamp. The fallback is
* basically emulating what iperf 3.1 did.
*/
if (sp) {
end_time = timeval_diff(&sp->result->start_time, &sp->result->end_time);
if (test->sender) {
sp->result->sender_time = end_time;
if (sp->result->receiver_time == 0.0) {
sp->result->receiver_time = sp->result->sender_time;
}
}
else {
sp->result->receiver_time = end_time;
if (sp->result->sender_time == 0.0) {
sp->result->sender_time = sp->result->receiver_time;
}
}
sender_time = sp->result->sender_time;
receiver_time = sp->result->receiver_time;