mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
net/tcp: return ENOTCONN if the connect migrate to the closed state
Change-Id: I15ee2a7ccbdc792c2c910ee9632714622bc5e0fd Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -728,7 +728,7 @@ ssize_t psock_tcp_recvfrom(FAR struct socket *psock, FAR void *buf,
|
||||
* recvfrom() will get an end-of-file indication.
|
||||
*/
|
||||
|
||||
if (ret <= 0 && !_SS_ISCLOSED(psock->s_flags))
|
||||
if (ret <= 0 || _SS_ISCLOSED(psock->s_flags))
|
||||
{
|
||||
/* Nothing was previously received from the read-ahead buffers.
|
||||
* The SOCK_STREAM must be (re-)connected in order to receive any
|
||||
|
||||
Reference in New Issue
Block a user