[sync] Syncing with the P1i
Jan Schneider
jan at horde.org
Fri Oct 2 17:51:27 UTC 2009
Zitat von Martin Zoller <mailinglists at zollerit.ch>:
> Hello
>
> I think you're right about the linebreak, Jan. But that would mean that
> *Horde* doesn't count it, because the higher number (153 bytes) comes
> from the *phone*. That's because the data already gets trimmed: In
> Command/Sync.php on line 225.
Gotcha! I got the numbers wrong, so this seems to be a bug in Horde.
> Now that we have this explanation for the size mismatch, it wouldn't be
> too elegant to just accept "wrong" size specifications as in Arvid's
> patch. Maybe we should store the 'trimmed' and the 'untrimmed' length of
> the data and accept both of them? Because removing the trim() commands
> might break other clients.
Well, if it does, then *those* clients are broken, and we have to find
a workaround for it. I guess it works for most clients, because they
don't include a trailing CRLF.
> Jan Schneider wrote:
>> Zitat von Martin Zoller <mailinglists at zollerit.ch>:
>>
>>> Good afternoon
>>>
>>> Jan Schneider wrote:
>>>> Please keep discussions on the list.
>>> Sorry, I must have used "reply" instead of "reply all".
>>>
>>>>
>>>>> The thing is, I only have the *.wbxml files and they are binary.
>>>>> I think there is no <Data> tag there.
>>>>
>>>> You can decode them with wbxml2xml.
>>> OK. The sizes don't make sense to me yet. Take this item, for example:
>>>
>>> <Replace>
>>> <CmdID>9</CmdID>
>>> <Meta>
>>> <Type xmlns="syncml:metinf">text/x-vcard</Type>
>>> <Size xmlns="syncml:metinf">153</Size>
>>> </Meta>
>>> <Item>
>>> <Source>
>>> <LocURI>59</LocURI>
>>> </Source>
>>> <Meta>
>>> <Type xmlns="syncml:metinf">text/x-vcard</Type>
>>> </Meta>
>>> <Data><![CDATA[BEGIN:VCARD
>>> VERSION:2.1
>>> REV:20090910T144434Z
>>> UID:14ecf97979509240-00e1365b3ef3b7c5-425
>>> N:Westman;Aron;;;
>>> TEL;WORK;VOICE;CELL:0733665130
>>> END:VCARD
>>> ]]></Data>
>>> </Item>
>>> </Replace>
>>>
>>> There are 165 bytes between <Data> and </Data>.
>>> The <Size> tag specifies the size as 153. In log.txt it says:
>>> ERR: Item size mismatch. Size reported as 153 but actual size is 151
>>> So I guess the <![CDATA[ ]]> tags are not counted? Because if you count
>>> only the actual VCARD data (including BEGIN:VCARD and END:VCARD), you
>>> get exactly 151 bytes.
>>
>> The CDATA is part of the XML markup, so 153 is correct. My guess is
>> that the phone doesn't count the trailing line break. Trimming the
>> <Data> content would probably fix that, but I'm afraid that might
>> break other clients.
>>
>> Jan.
>>
>
>
> --
> sync mailing list - Join the hunt: http://horde.org/bounties/#sync
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: sync-unsubscribe at lists.horde.org
>
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the sync
mailing list