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

(-)a/src/internet-stack/tcp-socket-impl.cc (-10 / +3 lines)
 Lines 80-87   TcpSocketImpl::GetTypeId () Link Here 
80
    m_pendingData (0),
80
    m_pendingData (0),
81
    m_rtt (0),
81
    m_rtt (0),
82
    m_lastMeasuredRtt (Seconds(0.0)),
82
    m_lastMeasuredRtt (Seconds(0.0)),
83
    m_rxAvailable (0), 
83
    m_rxAvailable (0)
84
    m_wouldBlock (false) 
85
{
84
{
86
  NS_LOG_FUNCTION (this);
85
  NS_LOG_FUNCTION (this);
87
}
86
}
 Lines 126-132   TcpSocketImpl::TcpSocketImpl(const TcpSo Link Here 
126
    m_cnTimeout (sock.m_cnTimeout),
125
    m_cnTimeout (sock.m_cnTimeout),
127
    m_cnCount (sock.m_cnCount),
126
    m_cnCount (sock.m_cnCount),
128
    m_rxAvailable (0),
127
    m_rxAvailable (0),
129
    m_wouldBlock (false),
130
    m_sndBufSize (sock.m_sndBufSize),
128
    m_sndBufSize (sock.m_sndBufSize),
131
    m_rcvBufSize(sock.m_rcvBufSize)
129
    m_rcvBufSize(sock.m_rcvBufSize)
132
{
130
{
 Lines 356-362   TcpSocketImpl::Send (Ptr<Packet> p, uint Link Here 
356
  {
354
  {
357
    if (p->GetSize() > GetTxAvailable ())
355
    if (p->GetSize() > GetTxAvailable ())
358
    {
356
    {
359
      m_wouldBlock = true;
360
      m_errno = ERROR_MSGSIZE;
357
      m_errno = ERROR_MSGSIZE;
361
      return -1;
358
      return -1;
362
    }
359
    }
 Lines 796-804   bool TcpSocketImpl::ProcessPacketAction Link Here 
796
      {
798
      {
797
        m_highestRxAck = tcpHeader.GetAckNumber ();
799
        m_highestRxAck = tcpHeader.GetAckNumber ();
798
        // Data freed from the send buffer; notify any blocked sender
800
        // Data freed from the send buffer; notify any blocked sender
799
        if (m_wouldBlock)
801
        if (GetTxAvailable () > 0)
800
          {
802
          {
801
            m_wouldBlock = false;
802
            NotifySend (GetTxAvailable ());
803
            NotifySend (GetTxAvailable ());
803
          }
804
          }
804
      }
805
      }
 Lines 1168-1178   void TcpSocketImpl::CommonNewAck (Sequen Link Here 
1168
  NS_LOG_LOGIC ("TCP " << this << " NewAck " << ack 
1169
  NS_LOG_LOGIC ("TCP " << this << " NewAck " << ack 
1169
           << " numberAck " << (ack - m_highestRxAck)); // Number bytes ack'ed
1170
           << " numberAck " << (ack - m_highestRxAck)); // Number bytes ack'ed
1170
  m_highestRxAck = ack;         // Note the highest recieved Ack
1171
  m_highestRxAck = ack;         // Note the highest recieved Ack
1171
  if (m_wouldBlock)
1172
  if (GetTxAvailable () > 0)
1172
    {
1173
    {
1173
      // m_highestRxAck advancing means some data was acked, and the size 
1174
      // of free space in the buffer has increased
1175
      m_wouldBlock = false;
1176
      NotifySend (GetTxAvailable ());
1174
      NotifySend (GetTxAvailable ());
1177
    }
1175
    }
1178
  if (ack > m_nextTxSequence) 
1176
  if (ack > m_nextTxSequence) 
(-)a/src/internet-stack/tcp-socket-impl.h (-2 lines)
 Lines 216-223   private: Link Here 
216
  // Temporary queue for delivering data to application
216
  // Temporary queue for delivering data to application
217
  uint32_t m_rxAvailable;
217
  uint32_t m_rxAvailable;
218
218
219
  bool m_wouldBlock;  // set to true whenever socket would block on send()
220
221
  // Attributes
219
  // Attributes
222
  uint32_t m_sndBufSize;   // buffer limit for the outgoing queue
220
  uint32_t m_sndBufSize;   // buffer limit for the outgoing queue
223
  uint32_t m_rcvBufSize;   // maximum receive socket buffer size
221
  uint32_t m_rcvBufSize;   // maximum receive socket buffer size

Return to bug 237