Adding special processing in SyncLog and ContentStore when forwardingHint is a prefix to userName
Change-Id: I1c9eedcc60a1170be46886dc964b90118b764d24
diff --git a/src/sync-log.cc b/src/sync-log.cc
index 74506c6..5bd5703 100644
--- a/src/sync-log.cc
+++ b/src/sync-log.cc
@@ -367,12 +367,19 @@
}
void
-SyncLog::UpdateLocalLocator (const Ccnx::Name &locator)
+SyncLog::UpdateLocalLocator (const Ccnx::Name &forwardingHint)
{
- return UpdateLocator (m_localName, locator);
+ if (m_localName.size () >= forwardingHint.size () &&
+ m_localName.getPartialName (0, forwardingHint.size ()) == forwardingHint)
+ {
+ return UpdateLocator (m_localName, Name ("/")); // "directly" accesible
+ }
+ else
+ {
+ return UpdateLocator (m_localName, forwardingHint);
+ }
}
-
SyncStateMsgPtr
SyncLog::FindStateDifferences (const std::string &oldHash, const std::string &newHash, bool includeOldSeq)
{