From 16a532893b4a6ccd79017f3b3d32fa118181fd89 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 12 Dec 2012 18:34:40 +0100 Subject: [PATCH 1/2] Revert "SyncML: workarounds for broken peers" This reverts commit 3a71a2bf530e5f69d5545c3fa6d924a3ddf57c17 and commit a0375e0160df06cd010dab4db2135d276faa968b. Need to back out the workaround for broken peers because it breaks SyncEvolution<->SyncEvolution syncing. --- NEWS | 27 ---------------- src/syncevo/SyncConfig.cpp | 62 ++++++++++--------------------------- src/syncevo/SyncConfig.h | 6 +--- src/syncevo/SyncContext.cpp | 5 +-- 4 files changed, 19 insertions(+), 81 deletions(-) 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"; From 453ee98740a654fbfbc72cc66b38230ba4b0f5be Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 12 Dec 2012 18:57:17 +0100 Subject: [PATCH 2/2] autotools: bump version to 1.3.99.2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 340cf7ce..3f92e3e9 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ dnl Invoke autogen.sh to produce a configure script. # # Starting with the 1.1 release cycle, the rpm-style # .99 pseudo-version number is used to mark a pre-release. -AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.3.99.1])]) +AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.3.99.2])]) # STABLE_VERSION=1.0.1+ AC_SUBST(STABLE_VERSION)