Adding special processing for 0 (zero-root) digest
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index cd74f2b..0f71b95 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -118,7 +118,7 @@
void
SyncLogic::processSyncData (const string &name, const string &dataBuffer)
{
- //cout << "Process Sync Data" <<endl;
+ //cout << "Process Sync Data" <<endl;
DiffStatePtr diffLog = make_shared<DiffState> ();
try
@@ -211,41 +211,41 @@
void
SyncLogic::processPendingSyncInterests (DiffStatePtr &diffLog)
{
- //cout << "Process Pending Interests" <<endl;
+ //cout << "Process Pending Interests" <<endl;
recursive_mutex::scoped_lock lock (m_stateMutex);
- diffLog->setDigest(m_state.getDigest());
- if (m_log.size () > 0)
+ diffLog->setDigest (m_state.getDigest());
+ if (m_log.get<sequenced> ().size () > 0)
{
m_log.get<sequenced> ().front ()->setNext (diffLog);
}
- m_log.insert (diffLog);
+ m_log.get<sequenced> ().push_back (diffLog);
vector<string> pis = m_syncInterestTable.fetchAll ();
if (pis.size () > 0)
{
- stringstream ss;
+ stringstream ss;
ss << *diffLog;
- for (vector<string>::iterator ii = pis.begin(); ii != pis.end(); ++ii)
- {
- m_ccnxHandle->publishData (*ii, ss.str(), m_syncResponseFreshness);
- }
-}
+ for (vector<string>::iterator ii = pis.begin(); ii != pis.end(); ++ii)
+ {
+ m_ccnxHandle->publishData (*ii, ss.str(), m_syncResponseFreshness);
+ }
+ }
}
void
SyncLogic::addLocalNames (const string &prefix, uint32_t session, uint32_t seq)
{
- //cout << "Add local names" <<endl;
+ //cout << "Add local names" <<endl;
recursive_mutex::scoped_lock lock (m_stateMutex);
NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
- SeqNo seqN(session, seq);
+
+ SeqNo seqN (session, seq);
m_state.update(info, seqN);
DiffStatePtr diff = make_shared<DiffState>();
diff->update(info, seqN);
-
- processPendingSyncInterests(diff);
+ processPendingSyncInterests (diff);
}
void
@@ -258,7 +258,7 @@
DiffStatePtr diff = make_shared<DiffState>();
diff->remove(info);
- processPendingSyncInterests(diff);
+ processPendingSyncInterests (diff);
}
void