mgmt: improved interest filter matching and bug fixes
tests/mgmt: added test fixtures to simplify unit testing
Added control response Data signing
Fixed control response payload parsing
Simplified fib-manager unit test assumptions
Expanded internal-face unit tests
refs: #1138
Change-Id: Ibe5d95ab9c42f890c0691c9040e4ae792e598974
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 5e561ff..2b27f85 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -29,47 +29,19 @@
uint32_t code,
const std::string& text)
{
- // Path 1 - runtime exception on receive's wireDecode.
- // Set Data response's content payload to the
- // encoded Block.
- {
- ndn::ControlResponse control(code, text);
- const Block& encodedControl = control.wireEncode();
+ ndn::ControlResponse control(code, text);
+ const Block& encodedControl = control.wireEncode();
- NFD_LOG_DEBUG("sending control response (Path 1)"
- << " Name: " << name
- << " code: " << code
- << " text: " << text);
+ NFD_LOG_DEBUG("sending control response"
+ << " Name: " << name
+ << " code: " << code
+ << " text: " << text);
- NFD_LOG_DEBUG("sending raw control block size = " << encodedControl.size());
+ Data response(name);
+ response.setContent(encodedControl);
- Data response(name);
- response.setContent(encodedControl);
-
- m_face->put(response);
- }
-
- // Path 2 - works, but not conformant to protocol.
- // Encode ControlResponse and append Block as
- // the last component of the name.
- // {
- // ndn::ControlResponse control(code, text);
- // const Block& encodedControl = control.wireEncode();
-
- // NFD_LOG_DEBUG("sending control response (Path 2)"
- // << " Name: " << name
- // << " code: " << code
- // << " text: " << text);
-
- // NFD_LOG_DEBUG("sending raw control block size = " << encodedControl.size());
-
- // Name responseName(name);
- // responseName.append(encodedControl);
-
- // Data response(responseName);
- // m_face->put(response);
- // }
-
+ m_keyChain.sign(response);
+ m_face->put(response);
}