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 2021/12/10 15:12:07 UTC

[GitHub] [incubator-nuttx] GUIDINGLI opened a new pull request #4973: socket rpmsg add ioctl & fix unblock connect crash

GUIDINGLI opened a new pull request #4973:
URL: https://github.com/apache/incubator-nuttx/pull/4973


   ## Summary
   socket rpmsg add ioctl & fix unblock connect crash
   
   ## Impact
   socket rpmsg
   
   ## Testing
   VELA
   
   


-- 
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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #4973: socket rpmsg add ioctl & fix unblock connect crash

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #4973:
URL: https://github.com/apache/incubator-nuttx/pull/4973#discussion_r767192581



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1145,7 +1133,23 @@ static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
         }
     }
 
-  return rpmsg_socket_send_internal(psock, buf, len, flags);
+  if (!conn->ept.rdev)
+    {
+      /* return ECONNRESET if lower IPC closed */
+
+      return -ECONNRESET;
+    }
+
+  nonblock = _SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT);

Review comment:
       ```suggestion
     nonblock = _SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0;
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1210,7 +1214,7 @@ static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
       goto out;
     }
 
-  if (_SS_ISNONBLOCK(psock->s_flags))
+  if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT))

Review comment:
       ```suggestion
     if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -914,7 +923,7 @@ static uint32_t rpmsg_socket_get_iovlen(FAR const struct iovec *buf,
 
 static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
                                             FAR const struct iovec *buf,
-                                            size_t iovcnt)
+                                            size_t iovcnt, int nonblock)

Review comment:
       ```suggestion
                                               size_t iovcnt, bool nonblock)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1007,7 +1016,7 @@ static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
 
 static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
                                         FAR const struct iovec *buf,
-                                        size_t iovcnt)
+                                        size_t iovcnt, int nonblock)

Review comment:
       ```suggestion
                                           size_t iovcnt, bool nonblock)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1099,36 +1108,15 @@ static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
   return ret > 0 ? len : ret;
 }
 
-static ssize_t rpmsg_socket_send_internal(FAR struct socket *psock,
-                                          FAR const void *buf,
-                                          size_t len, int flags)
-{
-  FAR struct rpmsg_socket_conn_s *conn = psock->s_conn;
-
-  if (!conn->ept.rdev)
-    {
-      /* return ECONNRESET if lower IPC closed */
-
-      return -ECONNRESET;
-    }
-
-  if (psock->s_type == SOCK_STREAM)
-    {
-      return rpmsg_socket_send_continuous(psock, buf, len);
-    }
-  else
-    {
-      return rpmsg_socket_send_single(psock, buf, len);
-    }
-}
-
 static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
                                     FAR struct msghdr *msg, int flags)
 {
+  FAR struct rpmsg_socket_conn_s *conn = psock->s_conn;
   FAR const struct iovec *buf = msg->msg_iov;
   size_t len = msg->msg_iovlen;
   FAR const struct sockaddr *to = msg->msg_name;
   socklen_t tolen = msg->msg_namelen;
+  int nonblock;

Review comment:
       ```suggestion
     bool nonblock;
   ```




-- 
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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #4973: socket rpmsg add ioctl & fix unblock connect crash

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #4973:
URL: https://github.com/apache/incubator-nuttx/pull/4973#discussion_r767192581



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1145,7 +1133,23 @@ static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
         }
     }
 
-  return rpmsg_socket_send_internal(psock, buf, len, flags);
+  if (!conn->ept.rdev)
+    {
+      /* return ECONNRESET if lower IPC closed */
+
+      return -ECONNRESET;
+    }
+
+  nonblock = _SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT);

Review comment:
       ```suggestion
     nonblock = _SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0;
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1210,7 +1214,7 @@ static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
       goto out;
     }
 
-  if (_SS_ISNONBLOCK(psock->s_flags))
+  if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT))

Review comment:
       ```suggestion
     if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -914,7 +923,7 @@ static uint32_t rpmsg_socket_get_iovlen(FAR const struct iovec *buf,
 
 static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
                                             FAR const struct iovec *buf,
-                                            size_t iovcnt)
+                                            size_t iovcnt, int nonblock)

Review comment:
       ```suggestion
                                               size_t iovcnt, bool nonblock)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1007,7 +1016,7 @@ static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
 
 static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
                                         FAR const struct iovec *buf,
-                                        size_t iovcnt)
+                                        size_t iovcnt, int nonblock)

Review comment:
       ```suggestion
                                           size_t iovcnt, bool nonblock)
   ```

##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -1099,36 +1108,15 @@ static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
   return ret > 0 ? len : ret;
 }
 
-static ssize_t rpmsg_socket_send_internal(FAR struct socket *psock,
-                                          FAR const void *buf,
-                                          size_t len, int flags)
-{
-  FAR struct rpmsg_socket_conn_s *conn = psock->s_conn;
-
-  if (!conn->ept.rdev)
-    {
-      /* return ECONNRESET if lower IPC closed */
-
-      return -ECONNRESET;
-    }
-
-  if (psock->s_type == SOCK_STREAM)
-    {
-      return rpmsg_socket_send_continuous(psock, buf, len);
-    }
-  else
-    {
-      return rpmsg_socket_send_single(psock, buf, len);
-    }
-}
-
 static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
                                     FAR struct msghdr *msg, int flags)
 {
+  FAR struct rpmsg_socket_conn_s *conn = psock->s_conn;
   FAR const struct iovec *buf = msg->msg_iov;
   size_t len = msg->msg_iovlen;
   FAR const struct sockaddr *to = msg->msg_name;
   socklen_t tolen = msg->msg_namelen;
+  int nonblock;

Review comment:
       ```suggestion
     bool nonblock;
   ```




-- 
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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #4973: socket rpmsg add ioctl & fix unblock connect crash

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4973:
URL: https://github.com/apache/incubator-nuttx/pull/4973


   


-- 
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