diff --git a/CHANGES.html b/CHANGES.html
index 3fde2a9c4..17dcf2e3e 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -1522,6 +1522,7 @@ a std::map of interface IDs and TTLs for the route.
Changed behavior:
+ - If the data inside the TCP buffer is less than the available window, TCP tries to ask for more data to the application, in the hope of filling the usable transmission window. In some cases, this change allows sending bigger packets than the previous versions, optimizing the transmission.
diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc
index ca677bdaf..6b2da7501 100644
--- a/src/internet/model/tcp-socket-base.cc
+++ b/src/internet/model/tcp-socket-base.cc
@@ -2806,8 +2806,16 @@ TcpSocketBase::SendPendingData (bool withAck)
// It's time to transmit, but before do silly window and Nagle's check
uint32_t availableData = m_txBuffer->SizeFromSequence (next);
+ // If there's less app data than the full window, ask the app for more
+ // data before trying to send
+ if (availableData < availableWindow)
+ {
+ NotifySend (GetTxAvailable ());
+ }
+
// Stop sending if we need to wait for a larger Tx window (prevent silly window syndrome)
- if (availableWindow < m_tcb->m_segmentSize && availableData > availableWindow)
+ // but continue if we don't have data
+ if (availableWindow < m_tcb->m_segmentSize && availableData > availableWindow)
{
NS_LOG_LOGIC ("Preventing Silly Window Syndrome. Wait to send.");
break; // No more