src: Error fixing
NLSR was crashing for using cref on local variable. Fixed that
and also added startNotification() in initialize method in nlsr.cpp
Change-Id: I2e326ae465f53bb518d83dfed3863882d4adcb98
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index ebbfd3e..0e6f09d 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -207,14 +207,14 @@
}
void
-HelloProtocol::registerPrefixes(const ndn::Name adjName, const std::string& faceUri,
+HelloProtocol::registerPrefixes(const ndn::Name& adjName, const std::string& faceUri,
double linkCost, uint64_t timeout)
{
ndn::Name broadcastKeyPrefix = DEFAULT_BROADCAST_PREFIX;
broadcastKeyPrefix.append("KEYS");
m_nlsr.getFib().registerPrefix(adjName, faceUri, linkCost, timeout,
ndn::bind(&HelloProtocol::onRegistrationSuccess,
- this, _1, ndn::cref(adjName)),
+ this, _1, adjName),
ndn::bind(&HelloProtocol::onRegistrationFailure,
this, _1, _2));
m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getChronosyncPrefix(),
@@ -227,7 +227,7 @@
void
HelloProtocol::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
- const ndn::Name neighbor)
+ const ndn::Name& neighbor)
{
Adjacent *adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
if (adjacent != 0) {