mirror of
https://github.com/apache/nuttx.git
synced 2026-08-12 07:55:32 +00: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:
parent
6a0ab27bd5
commit
c2642eef3c
1 changed files with 11 additions and 0 deletions
|
|
@ -134,6 +134,17 @@ void tcp_appsend(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||
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
|
||||
|
||||
/* Get the IP header length associated with the IP domain configured for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue