Checkpoint
diff --git a/model/sync-interest-table.cc b/model/sync-interest-table.cc
index a9ed265..a24e1e8 100644
--- a/model/sync-interest-table.cc
+++ b/model/sync-interest-table.cc
@@ -62,12 +62,19 @@
bool
SyncInterestTable::insert(const string &interest)
{
+ bool existent = false;
+
recursive_mutex::scoped_lock lock (m_mutex);
TableContainer::iterator it = m_table.find (interest);
if (it != m_table.end())
- m_table.erase(it);
+ {
+ existent = true;
+ m_table.erase(it);
+ }
time_t currentTime = time(0);
m_table.insert (make_pair(interest, currentTime));
+
+ return existent;
}
uint32_t
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index b77f29d..7fc9295 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -240,6 +240,10 @@
}
else
{
+ bool exists = m_syncInterestTable.remove (interestName);
+ if (exists)
+ return;
+
// m_recentUnknownDigests.insert (DigestTime (digest, TIME_NOW + TIME_SECONDS (m_unknownDigestStoreTime)));
uint32_t waitDelay = GET_RANDOM (m_rangeUniformRandom);
@@ -248,7 +252,7 @@
m_scheduler.schedule (TIME_MILLISECONDS (waitDelay),
bind (&SyncLogic::processSyncInterest, this, digest, interestName, true),
DELAYED_INTEREST_PROCESSING);
-
+
// just in case, re-express our interest (e.g., probably something bad happened)
// m_scheduler.cancel (REEXPRESSING_INTEREST);
@@ -262,7 +266,7 @@
// _LOG_TRACE (" (timed processing)");
_LOG_TRACE (">> D " << interestName << "/state" << " (timed processing)");
- m_syncInterestTable.remove (interestName + "/state");
+ m_syncInterestTable.remove (interestName);
m_ccnxHandle->publishData (interestName + "/state",
lexical_cast<string> (m_state),
m_syncResponseFreshness);