diff --git a/NEWS b/NEWS index ddc5cfc8..8eb80cba 100644 --- a/NEWS +++ b/NEWS @@ -169,33 +169,6 @@ Details: are timed separately, with duration printed to stdout. In addition, tools like "perf" can be started for the duration of one phase. -* SyncML: workarounds for broken peers - - Some peers have problems with meta data (CtCap, old Nokia phones) and - the sync mode extensions required for advertising the restart - capability (Oracle Beehive). - - Because the problem occurs when SyncEvolution contacts the peers - before it gets the device information from the peer, dynamic rules - based on the peer identifiers cannot be used. Instead the local config - must already disable these extra features in advance. - - The "SyncMLVersion" property gets extended for this. Instead of just - "SyncMLVersion = 1.0" (as before) it now becomes possible to say - "SyncMLVersion = 1.0, noctcap, norestart". - - "noctcap" disables sending CtCap. "norestart" disables the sync mode - extensions and thus doing multiple sync cycles in the same session - (used between SyncEvolution instances in some cases to get client and - server into sync in one session). - - Both keywords are case-insensitive. There's no error checking for - typos, so beware! - - The "SyncMLVersion" property was chosen because it was already in use - for configuring SyncML compatibility aspects and adding a new property - would have been harder. - * EDS: fix creating databases --create-database was broken in combination with the final code in EDS diff --git a/src/syncevo/SyncConfig.cpp b/src/syncevo/SyncConfig.cpp index 605ccb76..0e8b9fb0 100644 --- a/src/syncevo/SyncConfig.cpp +++ b/src/syncevo/SyncConfig.cpp @@ -1349,28 +1349,21 @@ static SafeConfigProperty syncPropPeerName("PeerName", "An arbitrary name for the peer referenced by this config.\n" "Might be used by a GUI. The command line tool always uses the\n" "the configuration name."); -static ConfigProperty syncPropSyncMLVersion("SyncMLVersion", - "On a client, the latest commonly supported SyncML version\n" - "is used when contacting a server. One of '1.0/1.1/1.2' can\n" - "be used to pick a specific version explicitly.\n" - "\n" - "On a server, this option controls what kind of Server Alerted\n" - "Notification is sent to the client to start a synchronization.\n" - "By default, first the format from 1.2 is tried, then in case\n" - "of failure, the older one from 1.1. 1.2/1.1 can be set\n" - "explicitly, which disables the automatism.\n" - "\n" - "Instead or in adddition to the version, several keywords can\n" - "be set in this property (separated by spaces or commas):\n" - "\n" - "- NOCTCAP = avoid sending CtCap meta information\n" - "- NORESTART = disable the sync mode extension that SyncEvolution\n" - " client and server use to negotiate whether both sides support\n" - " running multiple sync iterations in the same session\n" - "\n" - "Setting these flags should only be necessary as workaround for\n" - "broken peers.\n" - ); +static StringConfigProperty syncPropSyncMLVersion("SyncMLVersion", + "On a client, the latest commonly supported SyncML version \n" + "is used when contacting a server. one of '1.0/1.1/1.2' can\n" + "be used to pick a specific version explicitly.\n" + "\n" + "On a server, this option controls what kind of Server Alerted \n" + "Notification is sent to the client to start a synchronization.\n" + "By default, first the format from 1.2 is tried, then in case \n" + "of failure, the older one from 1.1. 1.2/1.1 can be choosen \n" + "explictely which disables the automatism\n", + "", + "", + Values() + + Aliases("") + Aliases("1.0") + Aliases ("1.1") + Aliases ("1.2") + ); static ConfigProperty syncPropRemoteIdentifier("remoteIdentifier", "the identifier sent to the remote peer for a server initiated sync.\n" @@ -1958,29 +1951,8 @@ void SyncConfig::setRemoteIdentifier (const string &value, bool temporarily) { r InitState SyncConfig::getPeerIsClient() const { return syncPropPeerIsClient.getPropertyValue(*getNode(syncPropPeerIsClient)); } void SyncConfig::setPeerIsClient(bool value, bool temporarily) { syncPropPeerIsClient.setProperty(*getNode(syncPropPeerIsClient), value, temporarily); } -InitStateString SyncConfig::getSyncMLVersion() const { - InitState< std::set > flags = getSyncMLFlags(); - static const char * const versions[] = { "1.2", "1.1", "1.0" }; - BOOST_FOREACH (const char *version, versions) { - if (flags.find(version) != flags.end()) { - return InitStateString(version, flags.wasSet()); - } - } - return InitStateString("", flags.wasSet()); -} -InitState< std::set > SyncConfig::getSyncMLFlags() const { - InitStateString value = syncPropSyncMLVersion.getProperty(*getNode(syncPropSyncMLVersion)); - std::list keywords; - // Work around g++ 4.4 + "array out of bounds" when using is_any_of() on plain string. - static const std::string delim(" ,"); - boost::split(keywords, value, boost::is_any_of(delim)); - std::set flags; - BOOST_FOREACH (std::string &keyword, keywords) { - boost::to_lower(keyword); - flags.insert(keyword); - } - return InitState< std::set >(flags, value.wasSet()); -} +InitStateString SyncConfig::getSyncMLVersion() const { return syncPropSyncMLVersion.getProperty(*getNode(syncPropSyncMLVersion)); } +void SyncConfig::setSyncMLVersion(const string &value, bool temporarily) { syncPropSyncMLVersion.setProperty(*getNode(syncPropSyncMLVersion), value, temporarily); } InitStateString SyncConfig::getUserPeerName() const { return syncPropPeerName.getProperty(*getNode(syncPropPeerName)); } void SyncConfig::setUserPeerName(const InitStateString &name) { syncPropPeerName.setProperty(*getNode(syncPropPeerName), name); } diff --git a/src/syncevo/SyncConfig.h b/src/syncevo/SyncConfig.h index f051d192..cd0d6ef1 100644 --- a/src/syncevo/SyncConfig.h +++ b/src/syncevo/SyncConfig.h @@ -1507,12 +1507,8 @@ class SyncConfig { virtual void setRemoteIdentifier (const std::string &value, bool temporaritly = false); virtual InitState getPeerIsClient () const; virtual void setPeerIsClient (bool value, bool temporarily = false); - - /** the 1.0/1.1/1.2 part of the SyncMLVersion property */ virtual InitStateString getSyncMLVersion() const; - - /** all flags that are set in the SyncMLVersion property, including the 1.0/1.1/1.2 versions */ - virtual InitState< std::set > getSyncMLFlags() const; + virtual void setSyncMLVersion (const std::string &value, bool temporarily = false); /** * An arbitrary name assigned to the peer configuration, diff --git a/src/syncevo/SyncContext.cpp b/src/syncevo/SyncContext.cpp index 46cb64ec..1c3ea4a7 100644 --- a/src/syncevo/SyncContext.cpp +++ b/src/syncevo/SyncContext.cpp @@ -2340,9 +2340,7 @@ void SyncContext::getConfigXML(string &xml, string &configname) unsigned long hash = 0; - std::set flags = getSyncMLFlags(); - bool noctcap = flags.find("noctcap") != flags.end(); - bool norestart = flags.find("norestart") != flags.end(); + const char *noctcap = getenv("SYNCEVOLUTION_NOCTCAP"); const char *sessioninitscript = " \n"; } - clientorserver << " " << (norestart ? "no" : "yes" ) << "\n"; if (noctcap) { clientorserver << " no\n" "\n";