mgmt: InternalFace processes Interest asynchronously
This avoids forwarding's incoming Data pipeline to be called
within incoming Interest pipeline - this property holds for
other faces, and is expected by forwarding.
refs #1419
Change-Id: I3eb1ca84830d5d8aefe0ae67a562acdd835ca5ca
diff --git a/daemon/mgmt/internal-face.cpp b/daemon/mgmt/internal-face.cpp
index 5552d02..81bd2de 100644
--- a/daemon/mgmt/internal-face.cpp
+++ b/daemon/mgmt/internal-face.cpp
@@ -5,6 +5,7 @@
*/
#include "internal-face.hpp"
+#include "core/global-io.hpp"
namespace nfd {
@@ -20,6 +21,15 @@
{
onSendInterest(interest);
+ // Invoke .processInterest a bit later,
+ // to avoid potential problems in forwarding pipelines.
+ getGlobalIoService().post(bind(&InternalFace::processInterest,
+ this, boost::cref(interest)));
+}
+
+void
+InternalFace::processInterest(const Interest& interest)
+{
if (m_interestFilters.size() == 0)
{
NFD_LOG_DEBUG("no Interest filters to match against");