microsoft / ntttcp-for-linux

A Linux network throughput multiple-thread benchmark tool.
https://github.com/Microsoft/ntttcp-for-linux
MIT License
389 stars 92 forks source link

tcpstream.c: Fix fd & mem leak in case of accept error #23

Closed santoshx closed 5 years ago

santoshx commented 5 years ago

Otherwise, for me, it is getting into infinite loop with following continuous prints:

03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24 03:53:33 ERR : error to accept new connections. errno = 24

santoshx commented 5 years ago

The change seems to solve the problem but I don't think it is a correct fix.