mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
tcp: fix tcp can not retransmit timely when ACK with TCP_NEWDATA
The current receive data needs to be handled by following tcp_recvhandler or tcp_data_event. Notify driver to send the message and marked as rexmit Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -593,18 +593,26 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
#ifdef CONFIG_NET_TCP_CC_NEWRENO
|
#ifdef CONFIG_NET_TCP_CC_NEWRENO
|
||||||
if (conn->dupacks >= TCP_FAST_RETRANSMISSION_THRESH)
|
if (conn->dupacks >= TCP_FAST_RETRANSMISSION_THRESH)
|
||||||
#else
|
#else
|
||||||
/* Reset the duplicate ack counter */
|
|
||||||
|
|
||||||
if ((flags & TCP_NEWDATA) != 0)
|
|
||||||
{
|
|
||||||
TCP_WBNACK(wrb) = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Duplicate ACK? Retransmit data if need */
|
/* Duplicate ACK? Retransmit data if need */
|
||||||
|
|
||||||
if (++TCP_WBNACK(wrb) == TCP_FAST_RETRANSMISSION_THRESH)
|
if (++TCP_WBNACK(wrb) == TCP_FAST_RETRANSMISSION_THRESH)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
/* Fast retransmission has been triggered */
|
||||||
|
|
||||||
|
if ((flags & TCP_NEWDATA) != 0)
|
||||||
|
{
|
||||||
|
/* The current receive data needs to be handled by
|
||||||
|
* following tcp_recvhandler or tcp_data_event. Notify
|
||||||
|
* driver to send the message and marked as rexmit
|
||||||
|
*/
|
||||||
|
|
||||||
|
TCP_WBNACK(wrb) = 0;
|
||||||
|
conn->timeout = true;
|
||||||
|
netdev_txnotify_dev(conn->dev);
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP_SELECTIVE_ACK
|
#ifdef CONFIG_NET_TCP_SELECTIVE_ACK
|
||||||
if ((conn->flags & TCP_SACK) &&
|
if ((conn->flags & TCP_SACK) &&
|
||||||
(tcp->tcpoffset & 0xf0) > 0x50)
|
(tcp->tcpoffset & 0xf0) > 0x50)
|
||||||
|
|||||||
Reference in New Issue
Block a user