From bf0d4e7154eea77a9be9c1e60e8217cc29187aef Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 15 Feb 2008 19:54:34 -0800 Subject: [PATCH] avoid infinite recursion in Tcp callback (bug 131) --- src/internet-node/tcp-socket.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/internet-node/tcp-socket.cc b/src/internet-node/tcp-socket.cc index 94fc976ee..d23e1f1e8 100644 --- a/src/internet-node/tcp-socket.cc +++ b/src/internet-node/tcp-socket.cc @@ -752,11 +752,13 @@ bool TcpSocket::SendPendingData (bool withAck) m_tcp->SendPacket (p, header, m_endPoint->GetLocalAddress (), m_defaultAddress); - m_rtt->SentSeq(m_nextTxSequence, sz); // notify the RTT - NotifyDataSent (p->GetSize () ); // notify the application - nPacketsSent++; // Count sent this loop - m_nextTxSequence += sz; // Advance next tx sequence - m_highTxMark = std::max (m_nextTxSequence, m_highTxMark);// Note the high water mark + m_rtt->SentSeq(m_nextTxSequence, sz); // notify the RTT + // Notify the application + Simulator::ScheduleNow(&TcpSocket::NotifyDataSent, this, p->GetSize ()); + nPacketsSent++; // Count sent this loop + m_nextTxSequence += sz; // Advance next tx sequence + // Note the high water mark + m_highTxMark = std::max (m_nextTxSequence, m_highTxMark); } NS_LOG_LOGIC ("Sent "<