When interest is satisfied from the local cache, the wrong order of
protocolHandler/retransmission setup function causes to set up
retransmission after data is satisfied. Putting protocolHandler call
after retransmission setup solves the issue.
closes #9
diff --git a/apps/ndn-consumer.cc b/apps/ndn-consumer.cc
index 98febd7..f8090fe 100644
--- a/apps/ndn-consumer.cc
+++ b/apps/ndn-consumer.cc
@@ -245,8 +245,6 @@
packet->AddHeader (interestHeader);
NS_LOG_DEBUG ("Interest packet size: " << packet->GetSize ());
- m_protocolHandler (packet);
-
NS_LOG_DEBUG ("Trying to add " << seq << " with " << Simulator::Now () << ". already " << m_seqTimeouts.size () << " items");
m_seqTimeouts.insert (SeqTimeout (seq, Simulator::Now ()));
@@ -254,6 +252,9 @@
m_transmittedInterests (&interestHeader, this, m_face);
m_rtt->SentSeq (SequenceNumber32 (seq), 1);
+
+ m_protocolHandler (packet);
+
ScheduleNextPacket ();
}