zhou lei | 23 Jan 06:12 2015

Re: xml instead of wbxml to format the syncML network stream

Hi Beat,

The sml_xml mode would get too many error print after testing sync with funambol ds.  But contact sync get success after the error log print. 

Have you ever meet one situation like this?

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- parsing UNKNOWN token, ext=undef/SyncML

- Tag start at 0x4C78027, scanner pos at 0x4C7802E, data:

3E 0A 3C 53 79 6E 63 48 64 72 3E 0A 3C 56 65 72 44 54 44 3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 

>_<SyncHdr>_<VerDTD>1.2</VerDTD>

xmlTag: smlErr 0x2001 (required field content missing) while parsing

- parsing UNKNOWN token, ext=undef/SyncML

- Tag start at 0x4C78027, scanner pos at 0x4C7802E, data:

3E 0A 3C 53 79 6E 63 48 64 72 3E 0A 3C 56 65 72 44 54 44 3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 

>_<SyncHdr>_<VerDTD>1.2</VerDTD>

xmlAttribute: smlErr 0x2001 (required field content missing) while parsing

- parsing start token, ext=undef/SyncML: <SyncML> (WBXML 0x2D, tagid=43)

- Tag start at 0x4C7802F, scanner pos at 0x4C78038, data:

3E 0A 3C 56 65 72 44 54 44 3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 0A 3C 56 65 72 50 72 6F 74 6F 

>_<VerDTD>1.2</VerDTD>_<VerProto

xmlTag: smlErr 0x2001 (required field content missing) while parsing

- parsing start token, ext=undef/SyncML: <SyncML> (WBXML 0x2D, tagid=43)

- Tag start at 0x4C7802F, scanner pos at 0x4C78038, data:

3E 0A 3C 56 65 72 44 54 44 3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 0A 3C 56 65 72 50 72 6F 74 6F 

>_<VerDTD>1.2</VerDTD>_<VerProto

xmlAttribute: smlErr 0x2001 (required field content missing) while parsing

- parsing start token, ext=undef/SyncML: <SyncHdr> (WBXML 0x2C, tagid=42)

- Tag start at 0x4C78039, scanner pos at 0x4C78041, data:

3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 0A 3C 56 65 72 50 72 6F 74 6F 3E 53 79 6E 63 4D 4C 2F 31 

>1.2</VerDTD>_<VerProto>SyncML/1

xmlTag: smlErr 0x2001 (required field content missing) while parsing

- parsing start token, ext=undef/SyncML: <SyncHdr> (WBXML 0x2C, tagid=42)

- Tag start at 0x4C78039, scanner pos at 0x4C78041, data:

3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E 0A 3C 56 65 72 50 72 6F 74 6F 3E 53 79 6E 63 4D 4C 2F 31 

>1.2</VerDTD>_<VerProto>SyncML/1

xmlAttribute: smlErr 0x2001 (required field content missing) while parsing

- parsing end token, ext=undef/SyncML: <VerDTD> (WBXML 0x31, tagid=47)

- Tag start at 0x4C7804E, scanner pos at 0x4C78058, data:

3E 53 79 6E 63 4D 4C 2F 31 2E 32 3C 2F 56 65 72 50 72 6F 74 6F 3E 0A 3C 53 65 73 73 69 6F 6E 49 

>SyncML/1.2</VerProto>_<SessionI

xmlTag: smlErr 0x2001 (required field content missing) while parsing

- parsing end token, ext=undef/SyncML: <VerDTD> (WBXML 0x31, tagid=47)

- Tag start at 0x4C7804E, scanner pos at 0x4C78058, data:

3E 53 79 6E 63 4D 4C 2F 31 2E 32 3C 2F 56 65 72 50 72 6F 74 6F 3E 0A 3C 53 65 73 73 69 6F 6E 49 

>SyncML/1.2</VerProto>_<SessionI

xmlAttribute: smlErr 0x2001 (required field content missing) while parsing

- parsing end token, ext=undef/SyncML: <VerProto> (WBXML 0x32, tagid=48)

- Tag start at 0x4C7806E, scanner pos at 0x4C78079, data:

3E 35 3C 2F 53 65 73 73 69 6F 6E 49 44 3E 0A 3C 4D 73 67 49 44 3E 31 3C 2F 4D 73 67 49 44 3E 0A 

>5</SessionID>_<MsgID>1</MsgID>_

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



Thanks

-zhoulei


2015-01-22 16:24 GMT+08:00 Beat Forster <beat.forster-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org>:
Hi Zhoulei

great:-)! Thanks for your feedback.

Have a good time.
Beat


Hi Beat,

Its a wonderful try. Thanks all of you guys. Set the "encoding" as a int value solve the issue.

Regards
-zhoulei

2015-01-21 17:50 GMT+08:00 Beat Forster <beat.forster <at> synthesis.ch>:
Hi Zhoulei

the "encoding" is correct.

- Use Int8 mode to write this value.
- Make sure that the profile will be closed before
  starting the sync session to get the value saved.

Best Regards
Beat

Hi Patrick,

Thanks for your suggestion. And I already try to set the encoding to 2, also try to define DEFAULT_ENCODING as "SML_XML", all not work.

The post content type get wbxml too. Like this:Content-Type: application/vnd.syncml+wbxml

Regards

-Zhoulei

2015-01-20 23:56 GMT+08:00 Patrick Ohly <patrick.ohly-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>:
On Tue, 2015-01-20 at 19:04 +0800, zhou lei wrote:
> Dear Lukas,
>
>
> I installing one syncML server which did not support WBXML, I have to
> format the syncML CMD with XML, not WBXML.
>
>
> As I know, libsynthesis already support XML, but I don't know how to
> switch WBXML to XML. Please kindly help on this.

In the sync profile, set the "encoding" key to 2 instead of 1. See
SDK_manual.pdf for setting keys. I'm not sure where that key
specifically is documented.

--
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.


_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis


--
-----------------------------------------------
       Beat FORSTER
       Dipl. El. Ing. ETH
       Dipl. NDS ETHZ in Betriebswissenschaften
       Managing Partner
       beat.forster-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org

Synthesis AG   SyncML Server & Client Solutions
Badenerstrasse 18,  CH-8004 Zürich, Switzerland
Tel (direct):       +41 44 440 66 02
Fax:                +41 44 440 66 04
email:              info-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org
web:          http://www.synthesis.ch
-----------------------------------------------


--
-----------------------------------------------
       Beat FORSTER
       Dipl. El. Ing. ETH
       Dipl. NDS ETHZ in Betriebswissenschaften
       Managing Partner
       beat.forster-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org

Synthesis AG   SyncML Server & Client Solutions
Badenerstrasse 18,  CH-8004 Zürich, Switzerland
Tel (direct):       +41 44 440 66 02
Fax:                +41 44 440 66 04
email:              info-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org
web:          http://www.synthesis.ch
-----------------------------------------------

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
zhou lei | 22 Jan 03:40 2015

Re: xml instead of wbxml to format the syncML network stream

Hi Beat,

Its a wonderful try. Thanks all of you guys. Set the "encoding" as a int value solve the issue.

Regards
-zhoulei

2015-01-21 17:50 GMT+08:00 Beat Forster <beat.forster-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org>:
Hi Zhoulei

the "encoding" is correct.

- Use Int8 mode to write this value.
- Make sure that the profile will be closed before
  starting the sync session to get the value saved.

Best Regards
Beat

Hi Patrick,

Thanks for your suggestion. And I already try to set the encoding to 2, also try to define DEFAULT_ENCODING as "SML_XML", all not work.

The post content type get wbxml too. Like this:Content-Type: application/vnd.syncml+wbxml

Regards

-Zhoulei

2015-01-20 23:56 GMT+08:00 Patrick Ohly <patrick.ohly <at> intel.com>:
On Tue, 2015-01-20 at 19:04 +0800, zhou lei wrote:
> Dear Lukas,
>
>
> I installing one syncML server which did not support WBXML, I have to
> format the syncML CMD with XML, not WBXML.
>
>
> As I know, libsynthesis already support XML, but I don't know how to
> switch WBXML to XML. Please kindly help on this.

In the sync profile, set the "encoding" key to 2 instead of 1. See
SDK_manual.pdf for setting keys. I'm not sure where that key
specifically is documented.

--
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.



_______________________________________________
os-libsynthesis mailing list
os-libsynthesis-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis


--
-----------------------------------------------
       Beat FORSTER
       Dipl. El. Ing. ETH
       Dipl. NDS ETHZ in Betriebswissenschaften
       Managing Partner
       beat.forster-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org

Synthesis AG   SyncML Server & Client Solutions
Badenerstrasse 18,  CH-8004 Zürich, Switzerland
Tel (direct):       +41 44 440 66 02
Fax:                +41 44 440 66 04
email:              info-zhcxFSZdvaOWpB8AXVHUkA@public.gmane.org
web:          http://www.synthesis.ch
-----------------------------------------------

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
zhou lei | 20 Jan 12:04 2015

xml instead of wbxml to format the syncML network stream

Dear Lukas,

I installing one syncML server which did not support WBXML, I have to format the syncML CMD with XML, not WBXML. 

As I know, libsynthesis already support XML, but I don't know how to switch WBXML to XML. Please kindly help on this.


Thanks

-zhoulei
_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
Patrick Ohly | 24 Sep 17:33 2014
Picon

aborting a sync -> slow sync

Hello Lukas!

Let me pick your brain for a second... :-)

When SyncEvolution runs a local sync (i.e. both client and server are
provided by SyncEvolution) and the sync gets aborted (= STEPCMD_ABORT is
passed to SessionStep()), I noticed that the next sync starts again as
if nothing happened.

For example, aborting a normal two-way sync and then syncing again does
another normal sync using the same sync anchors because the datastores's
SaveAdminData has never been called during the aborted sync.

The result is that the server can end up adding the same items twice,
once during the aborted sync and again during the next one. This causes
duplicates, because the client side has no means of detecting the
duplicate.

How is this case supposed to be handled? Is SyncEvolution doing
something wrong in its change or meta data handling?

My current workaround consists of detecting when the server side sends
data to the client and resetting the admin data. If the sync does not
complete, the next sync will be a slow sync because the server's sync
anchor is gone. Is there a better way?

--

-- 
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.
Patrick Ohly | 29 Aug 10:46 2014
Picon

avoiding disk writes during sync without changes

Hello!

For IVI, I am working on cloud syncing. When syncing against a WebDAV
server, SyncEvolution runs a two-way sync with binfile client on the
WebDAV side and a server with admin data handled by SyncEvolution on the
other side.

One goal for IVI is to minimize or better, avoid disk writes, because
flash storage must last as long as possible.

The most common case is that nothing changed on either side. In this
case, libsynthesis unnecessarily updates nonce (even if not used; I've
already patched that (1)), sync anchors (again, I have a patch for this:
skip writing of admin data after detecting the special case (2)) and the
change log in the binfile client.

This last write happens in TBinfileImplDS::changeLogPreflight(). The
changes are minor, just a few bytes change. I suspect that these are the
time stamps and modcount embedded in the log.

Would it be possible to check in changeLogPreflight() how significant
the changes are? If there were no item changes, what would be the effect
of not updating the header?

There are two cases where that can happen with the attached patch:
- the processes crashes
- SyncEvolution skips the session shutdown, see (2).

(1) For local sync, <requestedauth>none</requestedauth> and
<requiredauth>none</requiredauth> are used. Patch attached. Okay?

(2) This happens in SyncEvolution: the SaveAdminData implementation
detects that nothing happened during the sync, then returns an error to
libsynthesis and tells the SyncEvolution event loop to stop the sync
without sending the final reply message to the client. The server side
then finishes the sync successfully while the client side simply aborts
without doing its own session shutdown. This also eliminates
SaveAdminData on the binfile client side.

--

-- 
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.

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
Patrick Ohly | 11 Jul 15:27 2014
Picon

comparison of PHOTO data

Hello!

I'm currently investigating why a comparison of two PHOTO fields of
different length returns "field equal". PHOTO is defined as:

      <field name="PHOTO" type="string" compare="conflict" merge="fillempty"/>

I think the specific situation is that the two values contain a null
byte somewhere in the middle, and the part before that is equal.

I think the following code does the comparison, doesn't it?

sInt16 TStringField::compareWith(TItemField &aItemField, bool aCaseInsensitive)
{
  sInt16 result;
  PULLFROMPROXY;
  if (aItemField.isBasedOn(fty_string)) {
    TStringField *sfP = static_cast<TStringField *>(&aItemField);
    #ifdef STREAMFIELD_SUPPORT
    sfP->pullFromProxy(); // make sure we have all chars
    #endif
    // direct compare possible, return strcmp
    if (aCaseInsensitive)
      result=strucmp(fString.c_str(),sfP->fString.c_str());
    else
      result=strcmp(fString.c_str(),sfP->fString.c_str());
  }
...

We have std::string as value and therefore can store null bytes as part
of the data, but the actual comparison falls back to C-string
operations, which only work for null bytes at the end.

I think the strcmp() needs to be replaced with something that also looks
at the rest of the string if no difference is found. Agreed?

Or do we need a real "binary" type? Using string type for PHOTO also has
the risk that during a merge operation, the two values will get
concatenated (thus breaking the images) unless some custom merge script
resolves the conflict differently first.

--

-- 
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.
anuj chauhan | 19 May 15:16 2014
Picon

How to run syncevolution at bare minimum processing.

Hi ,


I am trying to run 300 concurrent sync-sessions from my machine with a server.
I have a quad-core machine with 8gb ram and these processes are consuming about 90-94% of the cpu usage.I want to tune syncevolution so that it could run on bare minimum processing.For this i have done following modification :

1.      Commented out the code which gets the Server DevInf. I suspect, this will reduce load on Server and client as well.

2.       Removed the file synccompare. During these concurrent runs, top command showed high CPU usage for Perl just after syncevolution completed its exercise. By removing this file, this reduced the client load and processing.

3.       Reduced the log level to 0. Number of IO went down along with the disk usage.

 

For server load testing i am not concerned with data loss and want minimal logging.

Can you suggest some more pieces of code/functionality which can be disabled so that the overall CPU usage goes down?



Regards
Anuj Chauhan

_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
Patrick Ohly | 14 May 21:15 2014
Picon

Re: mixing properties with and without group tag (was: Re: suppressempty + arrays)

On Wed, 2014-05-14 at 17:44 +0200, Lukas Zeller wrote:
> Hello Patrick,
> 
> On 12.05.2014, at 18:25, Patrick Ohly <patrick.ohly@...> wrote:
> 
> > [...] 
> >> and a property which has a group tag must not reuse any of these
> >> unassigned group tag values.
> > 
> > Actually, a "property which has a group *field*" - it doesn't matter
> > whether the current property has a group tag value. This check was
> > missing. Attached a patch adding it, in a brute-force manner. Does that
> > look right?
> 
> Yes, it looks right to me. I guess you've found out in the meantime if it also *works* right :-)

Yes, it works for me. But it's good that you had a look at it anyway,
because my vCard profile certainly isn't representative.

I'll include this and the other patches (including the removal of
backslash escaping in parameters!) in the master branch of libsynthesis
on freedesktop.org once it passed all my tests. There's also a memory
leak fix for SWAP().

--

-- 
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.
Patrick Ohly | 12 May 12:55 2014
Picon

suppressempty + arrays

Hello!

What's the intended behavior of suppressempty for arrays?

        "suppressempty": This optional boolean value. can be set to true if this property must
        never be sent empty (without values). This is the case for most vCalendar fields, for example.

The default seems to be suppressempty=no (judging from the "can be set
to true"). When I have arrays with empty entries, will those be
generated?

Example:

- 35 :     string RELATEDNAMES    [   0,   0,     0] : <array with 3
elements>
                                     -- element    0 : <empty>
                                     -- element    1 : <empty>
                                     -- element    2 : <empty>
...
- 83 :     string LABEL           [   0,   0,     0] : <array with 3 elements>
                                     -- element    0 : "Spouse"
                                     -- element    1 : "Manager"
                                     -- element    2 : "Assistant"

        <property name="X-ABRELATEDNAMES" groupfield="GROUP_TAG">
          <value field="RELATEDNAMES"/>
          <position field="RELATEDNAMES" repeat="array" increment="1" minshow="0"/>
          <parameter name="X-ABLabel" rule="HAVE-ABLABEL-PARAMETER" sharedfield="yes">
            <value field="LABEL"/>
          </parameter>
        </property>
...
        <property name="X-ABLabel" suppressempty="yes" groupfield="GROUP_TAG" rule="HAVE-ABLABEL-PROPERTY">
          <value field="LABEL" repeat="array" increment="1" minshow="0"/>
          <position field="LABEL" repeat="array" increment="1" minshow="1"/>
        </property>

This leads to:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Synthesis AG//NONSGML SyncML Engine V3.4.0.47//EN
REV:20140512T093706Z
UID:syuid384197.212266690650521
N:parserbug=;;;;
FN:parserbug=
X-EVOLUTION-FILE-AS:parserbug=
NICKNAME:user17
NOTE:triggers parser bug in Funambol 3.0: trailing = is mistaken for soft l
 ine break=
item3.X-ABLabel:Spouse
item2.X-ABLabel:Manager
item1.X-ABLabel:Assistant
END:VCARD

The X-ABRELATEDNAMES properties were not generated. The labels should be
redundant, but some peers get confused. Google preserves them as
stand-alone X-ABLabel without tag. DAViCal preserves them with tag,
which then happened to confuse SyncEvolution's conversion code (separate
issue).

--

-- 
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.
Patrick Ohly | 7 May 20:20 2014
Picon

[+ x] for next field

Hello!

The documentation mentions:

        In addition there is a special form of array index that can be
        used to access fields in a field list
        (see 10.1) by index instead of by name. This special form of
        array index starts with a + sign as the
        first character after the opening [ as shown in the following
        example:
        <!-- a sample field list -->
        <fieldlist>
        <field name="NAME" type="string"/>
        <field name="TEL_1" type="telephone"/>
        <field name="TEL_2" type="telephone"/>
        <field name="TEL_3" type="telephone"/>
        </fieldlist>

        /* sample script to access the telephone numbers by index
        instead of by name */
        integer i;
        telephone a,b,c;
        a = TEL_1[+0]; // this is the same as: a=TEL_1
        b = TEL_1[+1]; // this is the same as: b=TEL_2
        c = TEL_1[+2]; // this is the same as: c=TEL_3

Does this also work for fields which are arrays? Like this:

      <field name="TEL"         array="yes" type="telephone" compare="conflict"/>
      <field name="TEL_FLAGS"   array="yes" type="integer"   compare="conflict"/> <!-- offset 0 -->
      <field name="TEL_LABEL"   array="yes" type="string"    compare="conflict"/> <!-- offset 1 -->
      <field name="TEL_ID"      array="yes" type="integer"   compare="conflict"/> <!-- offset 2 -->
      <field name="TEL_SLOT"    array="yes" type="integer"   compare="never"/>    <!-- offset 3 -->

      a = TEL[+1][3]; // same as TEL_FLAGS[3]

I tried it briefly, but got a syntax error which implied that the first
square brackets were treated like a normal array index in TEL.

What would it take to make this work?

--

-- 
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.
anuj chauhan | 7 May 13:07 2014
Picon

Syncevoltion throwing error on log level < 4

Hi ,


I am facing a issue on reducing log level<4.Syncevolution is

throwing following error:


#[ERROR] basic_string::_S_construct null not valid


 Please suggest how to resolve this problem.




Thanks & Regards

Anuj Chauhan



_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@...
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Gmane