Closed confused-ddk-888 closed 1 year ago
Hi @confused-ddk-888, Yes, you're right.
Checking whether new_sock
is valid or not should be done as soon as possible, preferably right after accepting the connection. Furthermore, allowing setsockopt()
to occur for an invalid socket is an error.
Commit eb45cd5d2fcf748a06f50a7e0a5d781c198185b8 fixes this.
In function
ws_accept()
:condition
if (new_sock < 0)
may move up beforeif (timeout)
?