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:
Gregory Nutt 2019-12-09 08:45:52 -06:00
parent 6a0ab27bd5
commit c2642eef3c

View File

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