You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/01 02:19:45 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6972: net/usrsock: read from the closed remote should return EOF

xiaoxiang781216 commented on code in PR #6972:
URL: https://github.com/apache/incubator-nuttx/pull/6972#discussion_r960162073


##########
net/usrsock/usrsock_recvmsg.c:
##########
@@ -442,6 +442,12 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
       *fromlen = outaddrlen;
     }
 
+  if (conn->flags & USRSOCK_EVENT_REMOTE_CLOSED &&

Review Comment:
   With this patch, recvmsg always return 0 even in the abnormal case happen(cable unplug or disconnect from AP), which may not good. We would prefer fix the test case here instead:
   https://github.com/apache/incubator-nuttx-apps/pull/1304/commits/afd6554bab2acbf2cba4f20d39c46f36396a66fe



##########
net/usrsock/usrsock_recvmsg.c:
##########
@@ -442,6 +442,12 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
       *fromlen = outaddrlen;
     }
 
+  if (conn->flags & USRSOCK_EVENT_REMOTE_CLOSED &&

Review Comment:
   @masayuki2009 With this patch, recvmsg always return 0 even in the abnormal case happen(cable unplug or disconnect from AP), which may not good. We would prefer fix the test case here instead:
   https://github.com/apache/incubator-nuttx-apps/pull/1304/commits/afd6554bab2acbf2cba4f20d39c46f36396a66fe



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org