fw: remove onInterestUnsatisfied pipeline stage

Change-Id: Ic008bb26b87db176bac8d51230e53f923b19e5d2
refs: 4290
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 6d57a2d..cea2974 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -244,19 +244,6 @@
 }
 
 void
-Forwarder::onInterestUnsatisfied(const shared_ptr<pit::Entry>& pitEntry)
-{
-  NFD_LOG_DEBUG("onInterestUnsatisfied interest=" << pitEntry->getName());
-
-  // invoke PIT unsatisfied callback
-  this->dispatchToStrategy(*pitEntry,
-    [&] (fw::Strategy& strategy) { strategy.beforeExpirePendingInterest(pitEntry); });
-
-  // goto Interest Finalize pipeline
-  this->onInterestFinalize(pitEntry, false);
-}
-
-void
 Forwarder::onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
                               ndn::optional<time::milliseconds> dataFreshnessPeriod)
 {
@@ -511,7 +498,7 @@
 
   scheduler::cancel(pitEntry->m_unsatisfyTimer);
   pitEntry->m_unsatisfyTimer = scheduler::schedule(lastExpiryFromNow,
-    bind(&Forwarder::onInterestUnsatisfied, this, pitEntry));
+    bind(&Forwarder::onInterestFinalize, this, pitEntry, false, ndn::nullopt));
 }
 
 void
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 6d50909..a61aae8 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -214,11 +214,6 @@
   VIRTUAL_WITH_TESTS void
   onInterestReject(const shared_ptr<pit::Entry>& pitEntry);
 
-  /** \brief Interest unsatisfied pipeline
-   */
-  VIRTUAL_WITH_TESTS void
-  onInterestUnsatisfied(const shared_ptr<pit::Entry>& pitEntry);
-
   /** \brief Interest finalize pipeline
    *  \param isSatisfied whether the Interest has been satisfied
    *  \param dataFreshnessPeriod FreshnessPeriod of satisfying Data
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 284b1f2..d4d6827 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -157,12 +157,6 @@
 }
 
 void
-Strategy::beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry)
-{
-  NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
-}
-
-void
 Strategy::afterReceiveNack(const Face& inFace, const lp::Nack& nack,
                            const shared_ptr<pit::Entry>& pitEntry)
 {
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index e09b590..71fa506 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -148,22 +148,6 @@
   beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
                         const Face& inFace, const Data& data);
 
-  /** \brief trigger before PIT entry expires
-   *
-   *  PIT entry expires when InterestLifetime has elapsed for all InRecords,
-   *  and it is not satisfied by an incoming Data.
-   *
-   *  This trigger is not invoked for PIT entry already satisfied.
-   *
-   *  In this base class this method does nothing.
-   *
-   *  \warning The strategy must not retain shared_ptr<pit::Entry>, otherwise undefined behavior
-   *           may occur. However, the strategy is allowed to store weak_ptr<pit::Entry>,
-   *           although this isn't useful here because PIT entry would be deleted shortly after.
-   */
-  virtual void
-  beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry);
-
   /** \brief trigger after Nack is received
    *
    *  This trigger is invoked when an incoming Nack is received in response to
diff --git a/tests/daemon/fw/dummy-strategy.cpp b/tests/daemon/fw/dummy-strategy.cpp
index f806d08..28ca606 100644
--- a/tests/daemon/fw/dummy-strategy.cpp
+++ b/tests/daemon/fw/dummy-strategy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,6 @@
   : Strategy(forwarder)
   , afterReceiveInterest_count(0)
   , beforeSatisfyInterest_count(0)
-  , beforeExpirePendingInterest_count(0)
   , afterReceiveNack_count(0)
 {
   this->setInstanceName(name);
@@ -74,12 +73,6 @@
 }
 
 void
-DummyStrategy::beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry)
-{
-  ++beforeExpirePendingInterest_count;
-}
-
-void
 DummyStrategy::afterReceiveNack(const Face& inFace, const lp::Nack& nack,
                                 const shared_ptr<pit::Entry>& pitEntry)
 {
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index fb82add..1f168c5 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -69,9 +69,6 @@
                         const Face& inFace, const Data& data) override;
 
   void
-  beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry) override;
-
-  void
   afterReceiveNack(const Face& inFace, const lp::Nack& nack,
                    const shared_ptr<pit::Entry>& pitEntry) override;
 
@@ -91,7 +88,6 @@
 public:
   int afterReceiveInterest_count;
   int beforeSatisfyInterest_count;
-  int beforeExpirePendingInterest_count;
   int afterReceiveNack_count;
 
   shared_ptr<Face> interestOutFace;
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 55f51f7..a5118d8 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -298,12 +298,6 @@
   shared_ptr<Interest> interest4 = makeInterest("ndn:/B/4");
   interest4->setInterestLifetime(time::milliseconds(5000));
   forwarder.startProcessInterest(*face1, *interest4);
-
-  strategyA.beforeExpirePendingInterest_count = 0;
-  strategyB.beforeExpirePendingInterest_count = 0;
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(100));
-  BOOST_CHECK_EQUAL(strategyA.beforeExpirePendingInterest_count, 1);
-  BOOST_CHECK_EQUAL(strategyB.beforeExpirePendingInterest_count, 0);
 }
 
 BOOST_AUTO_TEST_CASE(IncomingData)