Avoid deprecated ndn-cxx functions
Also, waf is updated to version 2.0.23
Change-Id: I053d7dce733455ec352931a1614082542ca00570
diff --git a/src/logic.cpp b/src/logic.cpp
index 9d09bbc..05defbd 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -273,10 +273,7 @@
if (!m_isInReset) {
CHRONO_LOG_DBG("updateSeqNo: not in Reset");
ConstBufferPtr previousRoot = m_state.getRootDigest();
- {
- std::string hash = ndn::toHex(previousRoot->data(), previousRoot->size(), false);
- CHRONO_LOG_DBG("Hash: " << hash);
- }
+ printDigest(previousRoot);
bool isInserted = false;
bool isUpdated = false;
@@ -398,7 +395,7 @@
void
Logic::onSyncDataValidated(const Data& data)
{
- Name name = data.getName();
+ const auto& name = data.getName();
ConstBufferPtr digest = make_shared<ndn::Buffer>(name.get(-1).value(), name.get(-1).value_size());
try {
@@ -407,7 +404,7 @@
processSyncData(name, digest, Block(std::move(contentBuffer)));
}
catch (const std::ios_base::failure& error) {
- NDN_LOG_WARN("Error decompressing content of " << data.getName() << " (" << error.what() << ")");
+ NDN_LOG_WARN("Error decompressing content of " << name << " (" << error.what() << ")");
}
}
@@ -416,9 +413,8 @@
{
CHRONO_LOG_DBG(">> Logic::processSyncInterest");
- Name name = interest.getName();
+ const auto& name = interest.getName();
ConstBufferPtr digest = make_shared<ndn::Buffer>(name.get(-1).value(), name.get(-1).value_size());
-
ConstBufferPtr rootDigest = m_state.getRootDigest();
// If the digest of the incoming interest is the same as root digest
@@ -669,7 +665,7 @@
syncReply.setFreshnessPeriod(m_syncReplyFreshness);
auto finalizeReply = [this, &nodePrefix, &syncReply] (const State& state) {
- auto contentBuffer = bzip2::compress(reinterpret_cast<const char*>(state.wireEncode().wire()),
+ auto contentBuffer = bzip2::compress(reinterpret_cast<const char*>(state.wireEncode().data()),
state.wireEncode().size());
syncReply.setContent(contentBuffer);
@@ -737,10 +733,9 @@
}
void
-Logic::printDigest(ConstBufferPtr digest)
+Logic::printDigest(const ConstBufferPtr& digest) const
{
- std::string hash = ndn::toHex(digest->data(), digest->size(), false);
- CHRONO_LOG_DBG("Hash: " << hash);
+ CHRONO_LOG_DBG("Hash: " << ndn::toHex(*digest, false));
}
void
@@ -771,7 +766,7 @@
{
CHRONO_LOG_DBG(">> Logic::processRecoveryInterest");
- Name name = interest.getName();
+ const auto& name = interest.getName();
ConstBufferPtr digest = make_shared<ndn::Buffer>(name.get(-1).value(), name.get(-1).value_size());
ConstBufferPtr rootDigest = m_state.getRootDigest();