Fix some bugs
diff --git a/src/sync-logic.cc b/src/sync-logic.cc
index ef96a86..f40a36c 100644
--- a/src/sync-logic.cc
+++ b/src/sync-logic.cc
@@ -60,6 +60,7 @@
SyncLogic::SyncLogic (const Name& syncPrefix,
Ptr<SyncPolicyManager> syncPolicyManager,
+ Ptr<Wrapper> handler,
LogicUpdateCallback onUpdate,
LogicRemoveCallback onRemove)
: m_state (new FullState)
@@ -69,6 +70,7 @@
, m_onRemove (onRemove)
, m_perBranch (false)
, m_policyManager(syncPolicyManager)
+ , m_handler (handler)
#ifndef NS3_MODULE
, m_randomGenerator (static_cast<unsigned int> (std::time (0)))
, m_rangeUniformRandom (m_randomGenerator, uniform_int<> (200,1000))
@@ -82,10 +84,6 @@
#ifndef NS3_MODULE
// In NS3 module these functions are moved to StartApplication method
- Ptr<security::Keychain> keychain = Ptr<security::Keychain>(new security::Keychain(Ptr<security::IdentityManager>::Create(),
- m_policyManager,
- NULL));
- m_handler = Ptr<Wrapper>(new Wrapper(keychain));
m_handler->setInterestFilter (m_syncPrefix,
bind (&SyncLogic::respondSyncInterest, this, _1));
@@ -97,6 +95,7 @@
SyncLogic::SyncLogic (const Name& syncPrefix,
Ptr<SyncPolicyManager> syncPolicyManager,
+ Ptr<Wrapper> handler,
LogicPerBranchCallback onUpdateBranch)
: m_state (new FullState)
, m_syncInterestTable (TIME_SECONDS (m_syncInterestReexpress))
@@ -104,6 +103,7 @@
, m_onUpdateBranch (onUpdateBranch)
, m_perBranch(true)
, m_policyManager(syncPolicyManager)
+ , m_handler (handler)
#ifndef NS3_MODULE
, m_randomGenerator (static_cast<unsigned int> (std::time (0)))
, m_rangeUniformRandom (m_randomGenerator, uniform_int<> (200,1000))
@@ -116,14 +116,9 @@
{
#ifndef NS3_MODULE
// In NS3 module these functions are moved to StartApplication method
-
- Ptr<security::Keychain> keychain = Ptr<security::Keychain>(new security::Keychain(Ptr<security::IdentityManager>::Create(),
- m_policyManager,
- NULL));
- m_handler = Ptr<Wrapper>(new Wrapper(keychain));
m_handler->setInterestFilter (m_syncPrefix,
- bind (&SyncLogic::respondSyncInterest, this, _1));
+ bind (&SyncLogic::respondSyncInterest, this, _1));
m_scheduler.schedule (TIME_SECONDS (0), // no need to add jitter
bind (&SyncLogic::sendSyncInterest, this),