View | Details | Raw Unified | Return to bug 2214
Collapse All | Expand All

(-)a/src/internet/model/tcp-socket-base.cc (-15 / +5 lines)
 Lines 844-851   TcpSocketBase::Send (Ptr<Packet> p, uint32_t flags) Link Here 
844
        }
844
        }
845
      // Submit the data to lower layers
845
      // Submit the data to lower layers
846
      NS_LOG_LOGIC ("txBufSize=" << m_txBuffer->Size () << " state " << TcpStateName[m_state]);
846
      NS_LOG_LOGIC ("txBufSize=" << m_txBuffer->Size () << " state " << TcpStateName[m_state]);
847
      if (m_state == ESTABLISHED || m_state == CLOSE_WAIT)
847
      if ((m_state == ESTABLISHED || m_state == CLOSE_WAIT) && AvailableWindow () > 0)
848
        { // Try to send the data out
848
        { // Try to send the data out: Add a little step to allow the application
849
          // to fill the buffer
849
          if (!m_sendPendingDataEvent.IsRunning ())
850
          if (!m_sendPendingDataEvent.IsRunning ())
850
            {
851
            {
851
              m_sendPendingDataEvent = Simulator::Schedule (TimeStep (1),
852
              m_sendPendingDataEvent = Simulator::Schedule (TimeStep (1),
 Lines 1396-1408   TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress, Link Here 
1396
      NS_LOG_LOGIC (this << " Leaving zerowindow persist state");
1397
      NS_LOG_LOGIC (this << " Leaving zerowindow persist state");
1397
      m_persistEvent.Cancel ();
1398
      m_persistEvent.Cancel ();
1398
1399
1399
      // Try to send more data, since window has been updated
1400
      SendPendingData (m_connected);
1400
      if (!m_sendPendingDataEvent.IsRunning ())
1401
        {
1402
          m_sendPendingDataEvent = Simulator::Schedule (TimeStep (1),
1403
                                                        &TcpSocketBase::SendPendingData,
1404
                                                        this, m_connected);
1405
        }
1406
    }
1401
    }
1407
}
1402
}
1408
1403
 Lines 1659-1670   TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader) Link Here 
1659
1654
1660
  // RFC 6675, Section 5, point (C), try to send more data. NB: (C) is implemented
1655
  // RFC 6675, Section 5, point (C), try to send more data. NB: (C) is implemented
1661
  // inside SendPendingData
1656
  // inside SendPendingData
1662
  if (!m_sendPendingDataEvent.IsRunning ())
1657
  SendPendingData (m_connected);
1663
    {
1664
      m_sendPendingDataEvent = Simulator::Schedule (TimeStep (1),
1665
                                                    &TcpSocketBase::SendPendingData,
1666
                                                    this, m_connected);
1667
    }
1668
1658
1669
  // If there is any data piggybacked, store it into m_rxBuffer
1659
  // If there is any data piggybacked, store it into m_rxBuffer
1670
  if (packet->GetSize () > 0)
1660
  if (packet->GetSize () > 0)

Return to bug 2214