Use ndn::mgmt::Dispatcher for repo commands
refs #4129
Change-Id: Idb7826fc76b6660ce76d69e7e88a9e922c55a2e1
diff --git a/tools/ndnputfile.cpp b/tools/ndnputfile.cpp
index 583d478..b4f40f4 100644
--- a/tools/ndnputfile.cpp
+++ b/tools/ndnputfile.cpp
@@ -265,7 +265,8 @@
NdnPutFile::onInsertCommandResponse(const ndn::Interest& interest, const ndn::Data& data)
{
RepoCommandResponse response(data.getContent().blockFromValue());
- int statusCode = response.getStatusCode();
+ //int statusCode = response.getStatusCode();
+ int statusCode = response.getCode();
if (statusCode >= 400) {
BOOST_THROW_EXCEPTION(Error("insert command failed with code " +
boost::lexical_cast<std::string>(statusCode)));
@@ -397,7 +398,7 @@
NdnPutFile::onCheckCommandResponse(const ndn::Interest& interest, const ndn::Data& data)
{
RepoCommandResponse response(data.getContent().blockFromValue());
- int statusCode = response.getStatusCode();
+ int statusCode = response.getCode();
if (statusCode >= 400) {
BOOST_THROW_EXCEPTION(Error("Insert check command failed with code: " +
boost::lexical_cast<std::string>(statusCode)));
@@ -542,8 +543,8 @@
if (argc != 3)
usage();
- ndnPutFile.repoPrefix = Name(argv[0]);
- ndnPutFile.ndnName = Name(argv[1]);
+ ndnPutFile.repoPrefix = Name(argv[0]); std::cout << "Repo prefix: " << argv[0] << std::endl;
+ ndnPutFile.ndnName = Name(argv[1]); std::cout << "NDN name: " << argv[1] << std::endl;
if (strcmp(argv[2], "-") == 0) {
ndnPutFile.insertStream = &std::cin;