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

(-)a/src/internet/model/tcp-rx-buffer.h (+6 lines)
 Lines 175-180   public: Link Here 
175
   */
175
   */
176
  uint32_t GetSackListSize () const;
176
  uint32_t GetSackListSize () const;
177
177
178
  /**
179
   * \brief Says if a FIN bit has been received
180
   * \return true if we received a FIN bit
181
   */
182
  bool GotFin () const { return m_gotFin; }
183
178
private:
184
private:
179
  /**
185
  /**
180
   * \brief Update the sack list, with the block seq starting at the beginning
186
   * \brief Update the sack list, with the block seq starting at the beginning
(-)a/src/internet/model/tcp-socket-base.cc (-3 / +8 lines)
 Lines 2981-2995   uint16_t Link Here 
2981
TcpSocketBase::AdvertisedWindowSize (bool scale) const
2981
TcpSocketBase::AdvertisedWindowSize (bool scale) const
2982
{
2982
{
2983
  NS_LOG_FUNCTION (this << scale);
2983
  NS_LOG_FUNCTION (this << scale);
2984
  uint32_t w = (m_rxBuffer->MaxRxSequence () > m_rxBuffer->NextRxSequence ()) ?
2984
  uint32_t w;
2985
    m_rxBuffer->MaxRxSequence () - m_rxBuffer->NextRxSequence () : 0;
2986
2985
2987
  // We don't want to advertise 0 after a FIN is received. So, we just use
2986
  // We don't want to advertise 0 after a FIN is received. So, we just use
2988
  // the previous value of the advWnd.
2987
  // the previous value of the advWnd.
2989
  if (m_rxBuffer->Finished ())
2988
  if (m_rxBuffer->GotFin ())
2990
    {
2989
    {
2991
      w = m_advWnd;
2990
      w = m_advWnd;
2992
    }
2991
    }
2992
  else
2993
    {
2994
      uint32_t max = m_rxBuffer->MaxRxSequence ().GetValue ();
2995
      uint32_t next = m_rxBuffer->NextRxSequence ().GetValue ();
2996
      w = ( max > next ) ? max - next : 0;
2997
    }
2993
2998
2994
  // Ugly, but we are not modifying the state, that variable
2999
  // Ugly, but we are not modifying the state, that variable
2995
  // is used only for tracing purpose.
3000
  // is used only for tracing purpose.

Return to bug 2876