get rid of publisher and fetcher
modify SyncAppSocket API
modify SyncLogic API
Tweak SeqNo
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 3bae752..b44c2e8 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -279,6 +279,7 @@
DiffState diff;
istringstream ss (dataBuffer);
ss >> diff;
+ vector<MissingDataInfo> v;
BOOST_FOREACH (LeafConstPtr leaf, diff.getLeaves().get<ordered>())
{
DiffLeafConstPtr diffLeaf = dynamic_pointer_cast<const DiffLeaf> (leaf);
@@ -297,7 +298,12 @@
if (inserted || updated)
{
diffLog->update (info, seq);
- m_onUpdate (info->toString (), seq, oldSeq);
+ //m_onUpdate (info->toString (), seq, oldSeq);
+ MissingDataInfo mdi;
+ mdi.prefix = info->toString();
+ mdi.low = oldSeq;
+ mdi.high = seq;
+ v.push_back(mdi);
}
}
else if (diffLeaf->getOperation() == REMOVE)
@@ -314,6 +320,11 @@
}
}
+ if (!v.empty())
+ {
+ m_onUpdate(v);
+ }
+
insertToDiffLog (diffLog);
}
catch (Error::SyncXmlDecodingFailure &e)
@@ -470,7 +481,7 @@
bind (&SyncLogic::sendSyncInterest, this),
REEXPRESSING_INTEREST);
- m_ccnxHandle->sendInterest (os.str (),
+ m_ccnxHandle->sendInterestForString (os.str (),
bind (&SyncLogic::respondSyncData, this, _1, _2));
}
@@ -492,7 +503,7 @@
REEXPRESSING_RECOVERY_INTEREST);
}
- m_ccnxHandle->sendInterest (os.str (),
+ m_ccnxHandle->sendInterestForString (os.str (),
bind (&SyncLogic::respondSyncData, this, _1, _2));
}
@@ -502,7 +513,7 @@
{
_LOG_TRACE (">> D " << name);
// sending
- m_ccnxHandle->publishData (name,
+ m_ccnxHandle->publishStringData (name,
lexical_cast<string> (*state),
m_syncResponseFreshness); // in NS-3 it doesn't have any effect... yet