net: Fix unreadable error when doing poll operation on tcp socket.

When do poll operation and the tcp connection state is TCP_ALLOCATED, eventset(POLLERR|POLLHUP) is return, causing the libuv poll_multiple_handles to fail.

Verification: Use the libuv test case ` uv_run_tests poll_multiple_handles`.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
liqinhui 2023-03-24 16:30:27 +08:00 committed by Xiang Xiao
parent 78c88b5e78
commit 0100e8338e

View file

@ -219,7 +219,8 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
/* Non-blocking connection ? */
nonblock_conn = (conn->tcpstateflags == TCP_SYN_SENT &&
nonblock_conn = ((conn->tcpstateflags == TCP_ALLOCATED ||
conn->tcpstateflags == TCP_SYN_SENT) &&
_SS_ISNONBLOCK(conn->sconn.s_flags));
/* Find a container to hold the poll information */