xiaoxiang781216 commented on a change in pull request #4639:
URL: https://github.com/apache/incubator-nuttx/pull/4639#discussion_r726265980



##########
File path: net/tcp/tcp_timer.c
##########
@@ -140,6 +140,29 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct 
tcp_conn_s *conn,
   dev->d_len    = 0;
   dev->d_sndlen = 0;
 
+  if (conn->tcpstateflags == TCP_CLOSED)
+    {
+      /* Nothing to be done */
+
+      return;
+    }
+
+  /* The TCP connection is established and, hence, it should be bound
+   * to given device. Make sure that the polling device is the one that
+   * we are bound to. Otherwise, wait for the next poll from the correct
+   * device.
+   * NOTE: It is also important to decrease conn->timer at "hsec" pace,
+   * not faster. Excessive (false) decrements of conn->timer are not allowed
+   * here. Otherwise, it breaks TCP timings and leads to TCP spurious
+   * retransmissions and other issues due to premature timeouts.
+   */
+
+  DEBUGASSERT(conn->dev != NULL);
+  if (dev != conn->dev)

Review comment:
       look like we can merge two patch into one?




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