Hello!

John and I kept analyzing this offline. Thanks to John's help, I found
the root cause: he has so many sources configured, that generating the
DevInf for them exceeds a hard-coded limit of 12000 bytes in the SyncML
Toolkit library.

This in turn causes libsynthesis to log "SmlException: SyncML Toolkit
error=0x2002, smlResultsCmd, smlerr=8194" in the server HTML log file
before it bails out without sending anything back to the client (because
the message couldn't be encoded), which then leads to the "D-Bus server
done" error (because that's all that the HTTP server sees).

Unfortunately there is no nice solution short of patching libsynthesis
and the SyncML Toolkit that it contains. Is that important enough for a
1.1.2 release or can it wait until 1.2?

John, the patch is attached.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.

>From 722cb0154a4b82c522bbd04ea4209adf23a5b16c Mon Sep 17 00:00:00 2001
From: Patrick Ohly <[email protected]>
Date: Mon, 17 Jan 2011 11:11:09 +0100
Subject: [PATCH] SyncML TK: adjust size of DevInf buffer dynamically

The size of the buffer into which DevInf was encoded was limited to
~12KB, regardless of which message size was configured for the actual
message.

12KB is too small for larger numbers of databases, like 15, which
caused "SmlException: SyncML Toolkit error=0x2002, smlResultsCmd,
smlerr=8194".

This patch uses a DevInf buffer size which is as large as the
remaining buffer for the actual message, or the old size (just in
case, not expected to be used anymore).
---
 src/syncml_tk/src/sml/xlt/all/xltenc.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/syncml_tk/src/sml/xlt/all/xltenc.c b/src/syncml_tk/src/sml/xlt/all/xltenc.c
index 7cbcf3d..700874b 100755
--- a/src/syncml_tk/src/sml/xlt/all/xltenc.c
+++ b/src/syncml_tk/src/sml/xlt/all/xltenc.c
@@ -1457,9 +1457,17 @@ Ret_t subdtdEncWBXML(XltTagID_t tagId, XltRO_t reqOptFlag, const VoidPtr_t pCont
     /* Double the size of SubBufSize for the memory is small for some complex
      * content.
      */ 
-    Short_t           SubBufSize   = 12000 * 2; // for starters we use 12kB for each sub DTD to encode in WBXML
+    MemSize_t         SubBufSize   = 12000 * 2; // for starters we use 12kB for each sub DTD to encode in WBXML
     BufferMgmtPtr_t   pSubBufMgr   = NULL;
 
+    /* Even the doubled size was still too small. Instead of
+       hard-coding the size, make it as large as the buffer we are
+       copying into. The size of that one can be configured by the
+       user of the toolkit. -- Patrick Ohly */
+    MemSize_t VarSubBufSize = pBufMgr->smlXltBufferLen - pBufMgr->smlXltWrittenBytes;
+    if (VarSubBufSize > SubBufSize) {
+      SubBufSize = VarSubBufSize;
+    }
 
     // first create a sub buffer
     pSubBufMgr = (BufferMgmtPtr_t)smlLibMalloc(sizeof(BufferMgmt_t));
-- 
1.7.2.3

_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to