mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
net/tcp/tcp_appsend.c: Enhance delayed ACK algorithm with behavior of Windows delayed ACK described at https://support.microsoft.com/en-nz/help/214397/design-issues-sending-small-data-segments-over-tcp-with-winsock: 'If there are data to be sent in the same direction as the ACK before the second data packet is received and the delay timer expires, the ACK is piggybacked with the data segment and sent immediately.'
This commit is contained in:
@@ -134,6 +134,17 @@ void tcp_appsend(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there are data to be sent in the same direction as the ACK before
|
||||||
|
* the second data packet is received and the delay timer expires, the ACK
|
||||||
|
* is piggybacked with the data segment and sent immediately.
|
||||||
|
*/
|
||||||
|
|
||||||
|
else if (dev->d_sndlen > 0 && conn->rx_unackseg > 0)
|
||||||
|
{
|
||||||
|
result |= TCP_SNDACK;
|
||||||
|
conn->rx_unackseg = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Get the IP header length associated with the IP domain configured for
|
/* Get the IP header length associated with the IP domain configured for
|
||||||
|
|||||||
Reference in New Issue
Block a user