From 9a4c770d8e8b2ee5d8ac766faf7c7362fde3a82b Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 24 Apr 2013 12:00:45 +0200 Subject: engine: prevent timeouts in HTTP server mode HTTP SyncML clients give up after a certain timeout (SyncEvolution after RetryDuration = 5 minutes by default, Nokia e51 after 15 minutes) when the server fails to respond. This can happen with SyncEvolution as server when it uses a slow storage with many items, for example via WebDAV. In the case of slow session startup, multithreading is now used to run the storage initializing in parallel to sending regular "keep-alive" SyncML replies to the client. By default, these replies are sent every 2 minutes. This can be configured with another extensions of the SyncMLVersion property: SyncMLVersion = REQUESTMAXTIME=5m Other modes do not use multithreading by default, but it can be enabled by setting REQUESTMAXTIME explicitly. It can be disabled by setting the time to zero. The new feature depends on a libsynthesis with multithreading enabled and glib >= 2.32.0, which is necessary to make SyncEvolution itself thread-safe. With an older glib, multithreading is disabled, but can be enabled as a stop-gap measure by setting REQUESTMAXTIME explicitly. --- configure.ac | 2 +- src/syncevo/SyncConfig.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++-- src/syncevo/SyncConfig.h | 2 ++ src/syncevo/SyncContext.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 87 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index be784937..9d831e68 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ SE_CHECK_FOR_STABLE_RELEASE # Minimum version of libsynthesis as defined in its # configure script and thus .pc files: -define([SYNTHESIS_MIN_VERSION], [3.4.0.16.8]) +define([SYNTHESIS_MIN_VERSION], [3.4.0.16.9]) # Line above is patched by gen-autotools.sh. Handle # both "yes" and "no". diff --git a/src/syncevo/SyncConfig.cpp b/src/syncevo/SyncConfig.cpp index 9631b2f9..382714aa 100644 --- a/src/syncevo/SyncConfig.cpp +++ b/src/syncevo/SyncConfig.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -1363,10 +1364,28 @@ static ConfigProperty syncPropSyncMLVersion("SyncMLVersion", "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" + "- 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" + "- REQUESTMAXTIME=