fw: NccStrategy explore potential upstreams
ref: #3411
Change-Id: I30593e01b15a28a32011831659cce6e457633791
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 5f4c7fa..ef91c6b 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -215,8 +215,16 @@
}
shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
- if (static_cast<bool>(pitEntryInfo)) {
+ if (pitEntryInfo != nullptr) {
scheduler::cancel(pitEntryInfo->propagateTimer);
+
+ // Verify that the best face satisfied the interest before canceling the timeout call
+ shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
+ this->getMeasurementsEntryInfo(pitEntry);
+ shared_ptr<Face> bestFace = measurementsEntryInfo->getBestFace();
+
+ if (bestFace.get() == &inFace)
+ scheduler::cancel(pitEntryInfo->bestFaceTimeout);
}
}
diff --git a/daemon/fw/ncc-strategy.hpp b/daemon/fw/ncc-strategy.hpp
index 0c0991f..e9fb94e 100644
--- a/daemon/fw/ncc-strategy.hpp
+++ b/daemon/fw/ncc-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
beforeSatisfyInterest(shared_ptr<pit::Entry> pitEntry,
const Face& inFace, const Data& data) DECL_OVERRIDE;
-protected:
+PUBLIC_WITH_TESTS_ELSE_PROTECTED:
/// StrategyInfo on measurements::Entry
class MeasurementsEntryInfo : public StrategyInfo
{