local sync: allow sync and target context to be the same

It is possible to sync source A in context @X with source B in the
same context @X. The PIM manager is doing that with one context per
peer and databases that are guaranteed to not conflict with anything
else.

Therefore allow such configs. A better check is left for later, if it
really should be needed at all.
This commit is contained in:
Patrick Ohly 2012-09-18 19:30:21 +02:00
parent c0a975ad41
commit 8ab44f35a0
1 changed files with 8 additions and 3 deletions

View File

@ -86,9 +86,14 @@ void LocalTransportAgent::start()
m_clientContext.c_str(),
context.c_str()));
}
if (m_clientContext == m_server->getContextName()) {
SE_THROW(StringPrintf("invalid local sync inside context '%s', need second context with different databases", context.c_str()));
}
// TODO (?): check that there are no conflicts between the active
// sources. The old "contexts must be different" check achieved that
// via brute force (because by definition, databases from different
// contexts are meant to be independent), but it was too coarse
// and ruled out valid configurations.
// if (m_clientContext == m_server->getContextName()) {
// SE_THROW(StringPrintf("invalid local sync inside context '%s', need second context with different databases", context.c_str()));
// }
if (m_forkexec) {
SE_THROW("local transport already started");