config: enabled maxMsgSize/maxObjSize, removed obsolete loSupport (Bugzilla #2784)

The two size options are now copied into the Synthesis XML configuration.
Large object support is always on, so the setting was removed.

Note that the Synthesis engine allocates twice the amount specified in
the configuration and then uses that amount if the server allows it.
That explains why outgoing messages where twice as large as specified.
Incoming messages where inside the size limit.
This commit is contained in:
Patrick Ohly 2009-06-10 13:32:49 +02:00
parent 8f39efac6d
commit 0a5ded00cf
6 changed files with 24 additions and 22 deletions

View file

@ -346,7 +346,6 @@ public:
virtual void prepare() {
setLogDir(m_logbase, true);
setMaxLogDirs(0, true);
setLoSupport(m_options.m_loSupport, true);
setMaxObjSize(m_options.m_maxObjSize, true);
setMaxMsgSize(m_options.m_maxMsgSize, true);
setWBXML(m_options.m_isWBXML, true);

View file

@ -40,6 +40,7 @@ using namespace SyncEvolution;
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <algorithm>
using namespace std;
#include <boost/algorithm/string/predicate.hpp>
@ -1180,6 +1181,18 @@ static void substTag(string &xml, const string &tagname, const string &replaceme
}
}
static void substTag(string &xml, const string &tagname, const char *replacement)
{
substTag(xml, tagname, std::string(replacement));
}
template <class T> void substTag(string &xml, const string &tagname, const T replacement)
{
stringstream str;
str << replacement;
substTag(xml, tagname, str.str());
}
void EvolutionSyncClient::getConfigXML(string &xml, string &configname)
{
getConfigTemplateXML(xml, configname);
@ -1267,6 +1280,8 @@ void EvolutionSyncClient::getConfigXML(string &xml, string &configname)
// abuse (?) the firmware version to store the SyncEvolution version number
substTag(xml, "firmwareversion", getSwv());
substTag(xml, "devicetype", getDevType());
substTag(xml, "maxmsgsize", std::max(getMaxMsgSize(), 10000ul));
substTag(xml, "maxobjsize", std::max(getMaxObjSize(), 1024u));
}
SyncMLStatus EvolutionSyncClient::sync(SyncReport *report)

View file

@ -999,9 +999,8 @@ public:
"config.ini:# clientAuthType = syncml:auth-md5\n"
"config.ini:deviceId = fixed-devid\n" /* this is not the default! */
"config.ini:# enableWBXML = 0\n"
"config.ini:# maxMsgSize = 8192\n"
"config.ini:# maxObjSize = 500000\n"
"config.ini:# loSupport = 1\n"
"config.ini:# maxMsgSize = 20000\n"
"config.ini:# maxObjSize = 4000000\n"
"config.ini:# enableCompression = 0\n"
"config.ini:# SSLServerCertificates = \n"
"config.ini:# SSLVerifyServer = 1\n"
@ -1407,7 +1406,6 @@ protected:
"\n"
"maxMsgSize:\n"
"maxObjSize:\n"
"loSupport:\n"
"\n"
"enableCompression:\n"
"\n"

View file

@ -398,21 +398,12 @@ static StringConfigProperty syncPropClientAuthType("clientAuthType",
(Aliases("syncml:auth-basic") + "basic") +
(Aliases("syncml:auth-md5") + "md5" + ""));
static ULongConfigProperty syncPropMaxMsgSize("maxMsgSize",
"Support for large objects and limiting the message size was added in\n"
"SyncEvolution 0.5, but still disabled in the example configurations\n"
"of that version. Some servers had problems with that configuration,\n"
"so now both features are enabled by default and it is recommended\n"
"to update existing configurations.\n"
"\n"
"The maximum size of each message can be set (maxMsgSize) and the\n"
"server can be told to never sent items larger than a certain\n"
"threshold (maxObjSize). Presumably the server has to truncate or\n"
"skip larger items. Finally the client and server may be given the\n"
"permission to transmit large items in multiple messages (loSupport =\n"
"large object support).",
"8192");
static BoolConfigProperty syncPropLoSupport("loSupport", "", "T");
static UIntConfigProperty syncPropMaxObjSize("maxObjSize", "", "500000");
"skip larger items. Sizes are specified as number of bytes.",
"20000");
static UIntConfigProperty syncPropMaxObjSize("maxObjSize", "", "4000000");
static BoolConfigProperty syncPropCompression("enableCompression", "enable compression of network traffic (not currently supported)");
static BoolConfigProperty syncPropWBXML("enableWBXML",
@ -497,7 +488,6 @@ ConfigPropertyRegistry &EvolutionSyncConfig::getRegistry()
registry.push_back(&syncPropWBXML);
registry.push_back(&syncPropMaxMsgSize);
registry.push_back(&syncPropMaxObjSize);
registry.push_back(&syncPropLoSupport);
registry.push_back(&syncPropCompression);
registry.push_back(&syncPropSSLServerCertificates);
registry.push_back(&syncPropSSLVerifyServer);
@ -578,8 +568,6 @@ const char *EvolutionSyncConfig::getSyncURL() const { return m_stringCache.getPr
void EvolutionSyncConfig::setSyncURL(const string &value, bool temporarily) { syncPropSyncURL.setProperty(*m_configNode, value, temporarily); }
const char *EvolutionSyncConfig::getClientAuthType() const { return m_stringCache.getProperty(*m_configNode, syncPropClientAuthType); }
void EvolutionSyncConfig::setClientAuthType(const string &value, bool temporarily) { syncPropClientAuthType.setProperty(*m_configNode, value, temporarily); }
bool EvolutionSyncConfig::getLoSupport() const { return syncPropLoSupport.getProperty(*m_configNode); }
void EvolutionSyncConfig::setLoSupport(bool value, bool temporarily) { syncPropLoSupport.setProperty(*m_configNode, value, temporarily); }
unsigned long EvolutionSyncConfig::getMaxMsgSize() const { return syncPropMaxMsgSize.getProperty(*m_configNode); }
void EvolutionSyncConfig::setMaxMsgSize(unsigned long value, bool temporarily) { syncPropMaxMsgSize.setProperty(*m_configNode, value, temporarily); }
unsigned int EvolutionSyncConfig::getMaxObjSize() const { return syncPropMaxObjSize.getProperty(*m_configNode); }

View file

@ -695,8 +695,6 @@ class EvolutionSyncConfig {
virtual void setSyncURL(const string &value, bool temporarily = false);
virtual const char* getClientAuthType() const;
virtual void setClientAuthType(const string &value, bool temporarily = false);
virtual bool getLoSupport() const;
virtual void setLoSupport(bool value, bool temporarily = false);
virtual unsigned long getMaxMsgSize() const;
virtual void setMaxMsgSize(unsigned long value, bool temporarily = false);
virtual unsigned int getMaxObjSize() const;

View file

@ -9,6 +9,10 @@
<!-- this string is output to every session debug logfile to identify the config in use -->
<configidstring>SyncEvolution client config</configidstring>
<!-- information about maximum supported message and object size (in bytes) -->
<maxmsgsize/>
<maxobjsize/>
<!-- information for DevInf -->
<model/>
<manufacturer/>