diff -r 6e16bf523c55 src/internet-stack/tcp-socket-impl.cc --- a/src/internet-stack/tcp-socket-impl.cc Wed Mar 03 08:33:26 2010 -0800 +++ b/src/internet-stack/tcp-socket-impl.cc Thu Mar 04 12:32:01 2010 +0000 @@ -1501,7 +1501,7 @@ } // See if all pending ack'ed; if so we can delete the data if (m_pendingData) - { // Data exists, see if can be deleted + { // Data exists, see if can be entirely deleted if (m_pendingData->SizeFromSeq (m_firstPendingSequence, m_highestRxAck) == 0) { // All pending acked, can be deleted m_pendingData->Clear (); @@ -1513,6 +1513,24 @@ Simulator::GetDelayLeft (m_retxEvent)).GetSeconds()); m_retxEvent.Cancel (); } + else // else delete just a portion + { + while (m_pendingData->data.begin () != m_pendingData->data.end ()) + { + std::vector< Ptr >::iterator dataI = m_pendingData->data.begin (); + Ptr data = *dataI; + if (m_firstPendingSequence + SequenceNumber (data->GetSize ()) <= m_highestRxAck) + { + m_pendingData->data.erase (dataI); + m_pendingData->size -= data->GetSize (); + m_firstPendingSequence += data->GetSize (); + } + else + { + break; + } + } + } } // Try to send more data SendPendingData (m_connected);