mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user