Skip to content

Commit

Permalink
Merge pull request #1744 from davidBar-On/rcv-timeout-fix
Browse files Browse the repository at this point in the history
Fix rcv-timeout issue because of Nread timeout
  • Loading branch information
bmah888 authored Sep 13, 2024
2 parents 7679199 + 9e4ccfb commit 36deba4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2060,8 +2060,14 @@ iperf_recv_mt(struct iperf_stream *sp)
i_errno = IESTREAMREAD;
return r;
}
test->bytes_received += r;
++test->blocks_received;

/* Collect statistics only if receive did not timeout (e.g. `Nread()` may timeout).
* This is also important for `--rcv-timeout` to work properly.
*/
if (r > 0) {
test->bytes_received += r;
++test->blocks_received;
}

return 0;
}
Expand Down

0 comments on commit 36deba4

Please sign in to comment.