rib: Request Face create/destroy notification as early as possible
This commit does not completely solve the problem, as depending on ContentStore size and amount of updates, some notification still can be missed. However, this commit reduces chances for this to happen. Change-Id: I5456667c1fba1031146b379195de852f1561fd5d Refs: #1742
This commit is contained in:
1 parent
7465d5fc0c
commit
63108c4ace
2 files changed
+15
-3
No files matched your search
+12
-3
@@ -26,6 +26,7 @@
|
||||
#include "rib-manager.hpp"
|
||||
#include "core/global-io.hpp"
|
||||
#include "core/logger.hpp"
|
||||
#include "core/scheduler.hpp"
|
||||
|
||||
namespace nfd {
|
||||
namespace rib {
|
||||
@@ -532,12 +533,20 @@ RibManager::onNotification(const FaceEventNotification& notification)
|
||||
NFD_LOG_TRACE("onNotification: " << notification);
|
||||
if (notification.getKind() == ndn::nfd::FACE_EVENT_DESTROYED) //face destroyed
|
||||
{
|
||||
m_managedRib.erase(notification.getFaceId());
|
||||
|
||||
sendUpdatesToFibAfterFaceDestroyEvent();
|
||||
scheduler::schedule(time::seconds(0),
|
||||
bind(&RibManager::processErasureAfterNotification, this,
|
||||
notification.getFaceId()));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RibManager::processErasureAfterNotification(uint64_t faceId)
|
||||
{
|
||||
m_managedRib.erase(faceId);
|
||||
|
||||
sendUpdatesToFibAfterFaceDestroyEvent();
|
||||
}
|
||||
|
||||
void
|
||||
RibManager::sendUpdatesToFib(const shared_ptr<const Interest>& request,
|
||||
const ControlParameters& parameters)
|
||||
|
||||
@@ -176,6 +176,9 @@ private:
|
||||
void
|
||||
onNotification(const FaceEventNotification& notification);
|
||||
|
||||
void
|
||||
processErasureAfterNotification(uint64_t faceId);
|
||||
|
||||
void
|
||||
sendUpdatesToFib(const shared_ptr<const Interest>& request,
|
||||
const ControlParameters& parameters);
|
||||
|
||||
Reference in new issue
Block a user