fix memory leak/high cpu use on fd exhaustion
commit42143b138fc7fd8621dcfc8f2cc69276a1fe9bfe
authorjacob.huang <tjhuang.lec@gmail.com>
Mon, 29 Nov 2021 06:24:24 +0000 (29 14:24 +0800)
committerrofl0r <rofl0r@users.noreply.github.com>
Mon, 29 Nov 2021 09:37:01 +0000 (29 09:37 +0000)
tree873a84aab64b62344158fd50bf10a6fcf81da6bd
parentaf85aa1d9f8395b50da41228d247f77adff9563b
fix memory leak/high cpu use on fd exhaustion

if the maximum numbers of open file descriptors (often 1024, see ulimit -n)
is exhausted, accept() fails and we end up leaking memory.
in this fix, whenever failed to service client properly, wait for 1 ms before
accepting new connection.
sockssrv.c