a-lunev commented on a change in pull request #5589: URL: https://github.com/apache/incubator-nuttx/pull/5589#discussion_r813264210
########## File path: net/tcp/tcp_send_buffered.c ########## @@ -604,170 +603,116 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev, else if ((flags & TCP_REXMIT) != 0) { - rexmit = true; - } - - if (rexmit) - { + size_t sndlen; FAR struct tcp_wrbuffer_s *wrb; - FAR sq_entry_t *entry; + bool rexmit_from_write_q = false; - ninfo("REXMIT: %04x\n", flags); + /* According to RFC 6298 (5.4), retransmit the earliest segment + * that has not been acknowledged by the TCP receiver. + */ - /* If there is a partially sent write buffer at the head of the - * write_q? Has anything been sent from that write buffer? + /* If the unacked_q is not empty, retrasmit the eariest segment + * that is in the head of the unacked_q. */ - wrb = (FAR struct tcp_wrbuffer_s *)sq_peek(&conn->write_q); - ninfo("REXMIT: wrb=%p sent=%u\n", wrb, wrb ? TCP_WBSENT(wrb) : 0); + wrb = (FAR struct tcp_wrbuffer_s *)sq_peek(&conn->unacked_q); Review comment: Good. I will try to emulate namely that pattern and see how the stack behaves. -- 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