|
|
| 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. |