Apply Patch for Bug 237 ns-3.1-RC3
authorCraig Dowell <craigdo@ee.washington.edu>
Fri, 27 Jun 2008 14:56:18 -0700
changeset 3327ea16c44eb90d
parent 3326 239c4bc21ebf
child 3328 509acaf2966c
Apply Patch for Bug 237
src/internet-stack/tcp-socket-impl.cc
src/internet-stack/tcp-socket-impl.h
     1.1 --- a/src/internet-stack/tcp-socket-impl.cc	Fri Jun 27 14:38:08 2008 -0700
     1.2 +++ b/src/internet-stack/tcp-socket-impl.cc	Fri Jun 27 14:56:18 2008 -0700
     1.3 @@ -80,8 +80,7 @@
     1.4      m_pendingData (0),
     1.5      m_rtt (0),
     1.6      m_lastMeasuredRtt (Seconds(0.0)),
     1.7 -    m_rxAvailable (0), 
     1.8 -    m_wouldBlock (false) 
     1.9 +    m_rxAvailable (0)
    1.10  {
    1.11    NS_LOG_FUNCTION (this);
    1.12  }
    1.13 @@ -126,7 +125,6 @@
    1.14      m_cnTimeout (sock.m_cnTimeout),
    1.15      m_cnCount (sock.m_cnCount),
    1.16      m_rxAvailable (0),
    1.17 -    m_wouldBlock (false),
    1.18      m_sndBufSize (sock.m_sndBufSize),
    1.19      m_rcvBufSize(sock.m_rcvBufSize)
    1.20  {
    1.21 @@ -356,7 +354,6 @@
    1.22    {
    1.23      if (p->GetSize() > GetTxAvailable ())
    1.24      {
    1.25 -      m_wouldBlock = true;
    1.26        m_errno = ERROR_MSGSIZE;
    1.27        return -1;
    1.28      }
    1.29 @@ -796,9 +793,8 @@
    1.30        {
    1.31          m_highestRxAck = tcpHeader.GetAckNumber ();
    1.32          // Data freed from the send buffer; notify any blocked sender
    1.33 -        if (m_wouldBlock)
    1.34 +        if (GetTxAvailable () > 0)
    1.35            {
    1.36 -            m_wouldBlock = false;
    1.37              NotifySend (GetTxAvailable ());
    1.38            }
    1.39        }
    1.40 @@ -1168,11 +1164,8 @@
    1.41    NS_LOG_LOGIC ("TCP " << this << " NewAck " << ack 
    1.42             << " numberAck " << (ack - m_highestRxAck)); // Number bytes ack'ed
    1.43    m_highestRxAck = ack;         // Note the highest recieved Ack
    1.44 -  if (m_wouldBlock)
    1.45 +  if (GetTxAvailable () > 0)
    1.46      {
    1.47 -      // m_highestRxAck advancing means some data was acked, and the size 
    1.48 -      // of free space in the buffer has increased
    1.49 -      m_wouldBlock = false;
    1.50        NotifySend (GetTxAvailable ());
    1.51      }
    1.52    if (ack > m_nextTxSequence) 
     2.1 --- a/src/internet-stack/tcp-socket-impl.h	Fri Jun 27 14:38:08 2008 -0700
     2.2 +++ b/src/internet-stack/tcp-socket-impl.h	Fri Jun 27 14:56:18 2008 -0700
     2.3 @@ -216,8 +216,6 @@
     2.4    // Temporary queue for delivering data to application
     2.5    uint32_t m_rxAvailable;
     2.6  
     2.7 -  bool m_wouldBlock;  // set to true whenever socket would block on send()
     2.8 -
     2.9    // Attributes
    2.10    uint32_t m_sndBufSize;   // buffer limit for the outgoing queue
    2.11    uint32_t m_rcvBufSize;   // maximum receive socket buffer size