summaryrefslogtreecommitdiff
path: root/src/syncevo/LocalTransportAgent.cpp
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-09-18 19:30:21 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2012-10-25 16:43:46 +0200
commit8ab44f35a01f393f285ead90349f99dc323ec7e9 (patch)
tree4add77f1e3d1ebe21564e810dc60c897dd7f6d2b /src/syncevo/LocalTransportAgent.cpp
parentc0a975ad41aa162f38c5b2e76b5ec5bb4456c9e3 (diff)
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.
Diffstat (limited to 'src/syncevo/LocalTransportAgent.cpp')
-rw-r--r--src/syncevo/LocalTransportAgent.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/syncevo/LocalTransportAgent.cpp b/src/syncevo/LocalTransportAgent.cpp
index b1c19d5e..3232d0bd 100644
--- a/src/syncevo/LocalTransportAgent.cpp
+++ b/src/syncevo/LocalTransportAgent.cpp
@@ -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");