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/07/05 09:55:03 UTC

[GitHub] [incubator-nuttx] yamt commented on a change in pull request #4069: net/socket: add SO_RCVBUF support

yamt commented on a change in pull request #4069:
URL: https://github.com/apache/incubator-nuttx/pull/4069#discussion_r663800441



##########
File path: net/udp/udp_callback.c
##########
@@ -83,6 +83,14 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev,
   FAR void  *src_addr;
   uint8_t src_addr_size;
 
+#if CONFIG_NET_RECV_BUFSIZE > 0
+  while (iob_get_queue_size(&conn->readahead) > conn->rcvbufs)
+    {
+      iob = iob_remove_queue(&conn->readahead);
+      iob_free_chain(iob, IOBUSER_NET_UDP_READAHEAD);
+    }
+#endif

Review comment:
       does this mean to drop older packets first? why?

##########
File path: net/tcp/tcp_recvwindow.c
##########
@@ -181,6 +181,29 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev,
       recvwndo = tailroom;
     }
 
+#if CONFIG_NET_RECV_BUFSIZE > 0
+  /* Finally, check the receive buffer size further to avoid receive
+   * window out of desire.
+   */

Review comment:
       i guess than conn->readahead == NULL case should be treated as io_pktlen == 0.
   
   that is,
   ```
   queued_bytes = FIONREAD equivalent;
   sbleft = max(conn->rcv_bufs - queued_bytes, 0);
   recvwndo = min(recvwndo, sbleft);
   ```




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