fjpanag commented on code in PR #7286:
URL: https://github.com/apache/incubator-nuttx/pull/7286#discussion_r993895716


##########
net/tcp/tcp_recvfrom.c:
##########
@@ -698,43 +699,53 @@ ssize_t psock_tcp_recvfrom(FAR struct socket *psock, FAR 
struct msghdr *msg,
   /* We get here when we we decide that we need to setup the wait for
    * incoming TCP/IP data.  Just a few more conditions to check:
    *
-   * 1) Make sure thet there is buffer space to receive additional data
+   * 1) Make sure that there is buffer space to receive additional data
    *    (state.ir_buflen > 0).  This could be zero, for example,  we filled
    *    the user buffer with data from the read-ahead buffers.  And
    * 2) then we not want to wait if we already obtained some data from the
    *    read-ahead buffer.  In that case, return now with what we have (don't
    *    want for more because there may be no timeout).
+   * 3) If however MSG_WAITALL flag is set, block here till all requested
+   *    data are received (or there is a timeout / error).
    */
 
-  if (state.ir_recvlen == 0 && state.ir_buflen > 0)
+  if (((flags & MSG_WAITALL) != 0 || state.ir_recvlen == 0) &&
+      state.ir_buflen > 0)
     {
       /* Set up the callback in the connection */
 
       state.ir_cb = tcp_callback_alloc(conn);
       if (state.ir_cb)
         {
+          int ret2;

Review Comment:
   I'll remove `ret2`, as commented bellow.



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