fw: invoke FaceTable::remove upon Face::onFail
refs #1358
Change-Id: Ic19a88f0aea5adefbd3179de09f9f4e049922ff8
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index a3013f6..1ed79ad 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -31,9 +31,11 @@
NFD_LOG_INFO("addFace id=" << faceId);
face->onReceiveInterest += bind(&Forwarder::onInterest,
- &m_forwarder, boost::ref(*face), _1);
+ &m_forwarder, boost::ref(*face), _1);
face->onReceiveData += bind(&Forwarder::onData,
- &m_forwarder, boost::ref(*face), _1);
+ &m_forwarder, boost::ref(*face), _1);
+ face->onFail += bind(&FaceTable::remove,
+ this, face);
}
void
@@ -48,6 +50,7 @@
// does not support only removing Forwarder's subscription
face->onReceiveInterest.clear();
face->onReceiveData .clear();
+ // don't clear onFail because other functions may need to execute
m_forwarder.getFib().removeNextHopFromAllEntries(face);
}