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


##########
net/usrsock/usrsock_recvmsg.c:
##########
@@ -83,8 +83,9 @@ static uint16_t recvfrom_event(FAR struct net_driver_s *dev,
           pstate->valuelen_nontrunc = conn->resp.valuelen_nontrunc;
         }
 
-      if (pstate->reqstate.result >= 0 ||
-          pstate->reqstate.result == -EAGAIN)
+      if (!(flags & USRSOCK_EVENT_RECVFROM_AVAIL) &&

Review Comment:
   why change?



##########
net/usrsock/usrsock_connect.c:
##########
@@ -115,7 +116,13 @@ static int do_connect_request(FAR struct usrsock_conn_s 
*conn,
   bufs[1].iov_base = (FAR void *)addr;
   bufs[1].iov_len = addrlen;
 
-  return usrsockdev_do_request(conn, bufs, ARRAY_SIZE(bufs));
+  ret = usrsock_do_request(conn, bufs, ARRAY_SIZE(bufs));
+  if (ret == -ENETDOWN)
+    {
+      ret = -ECONNABORTED;

Review Comment:
   let's usrsock_do_request return the correct error code



##########
net/usrsock/usrsock_sendmsg.c:
##########
@@ -71,7 +71,8 @@ static uint16_t sendto_event(FAR struct net_driver_s *dev,
 
       pstate->result = conn->resp.result;
 
-      if (pstate->result >= 0 || pstate->result == -EAGAIN)
+      if (!(flags & USRSOCK_EVENT_SENDTO_READY) &&

Review Comment:
   ditto



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to