From 209c593a00408af13756a578a654cc133429e4b3 Mon Sep 17 00:00:00 2001 From: Ghostyhands <1248424-Ghostyhands@users.noreply.gitlab.com> Date: Sun, 28 Jul 2024 19:18:27 +0000 Subject: [PATCH] tcp: (merges !2083) Consider segmentSize send limit while checking for cwnd rate-limit --- src/internet/model/tcp-socket-base.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc index 499c716a2..874b3fdff 100644 --- a/src/internet/model/tcp-socket-base.cc +++ b/src/internet/model/tcp-socket-base.cc @@ -3259,7 +3259,8 @@ TcpSocketBase::SendDataPacket(SequenceNumber32 seq, uint32_t maxSize, bool withA // This is a simple version of Linux tcp_cwnd_validate() but following // the principle implemented in Linux that limits the updating of cwnd // (in the congestion controls) when flight size is >= cwnd - m_tcb->m_isCwndLimited = (BytesInFlight() >= m_tcb->m_cWnd); + // send will also be cwnd limited if less then one segment of cwnd is available + m_tcb->m_isCwndLimited = (m_tcb->m_cWnd < BytesInFlight() + m_tcb->m_segmentSize); UpdateRttHistory(seq, sz, isRetransmission);