Skip to content

Commit

Permalink
Closing server prot_listener socket after stream setup failure (esnet…
Browse files Browse the repository at this point in the history
…#1084)

Making sure the server closes prot_listener socket at the end of a session with a client. Without this change the socket may remain open, for example when there is a failure during the UDP stream establishment because the --window value is too high. Closing the socket was added to cleanup_server() as it seems to handle all cases where the socket may remain open.
  • Loading branch information
davidBar-On authored and hanvari committed Jul 3, 2021
1 parent b286f82 commit 29a709d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/iperf_server_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ cleanup_server(struct iperf_test *test)
if (test->listener) {
close(test->listener);
}
if (test->prot_listener > -1) { // May remain open if create socket failed
close(test->prot_listener);
}

/* Cancel any remaining timers. */
if (test->stats_timer != NULL) {
Expand Down

0 comments on commit 29a709d

Please sign in to comment.