[PATCH] Fix receive of plists larger than a packet
Reported by Martin S. | April 18th, 2009 @ 05:55 PM
Both the "lockdown recv" and "mobilesync recv" functions only request a single usbmux packet using "iphone_mux_recv()" and ignore that the datalen reported might be larger than the amount of bytes received.
This causes havok for larger plists (or actually any data) which the device spreads and sends to us among multiple usbmux packets.
The patch below fixes this for the mobile sync part. It allows to correctly receive mobile sync plists now, even if they contain a lot of data (like JPEG image data from contacts). libplist seems to have no trouble parsing the response afterwards, too.
The question is though, if this should be addressed in each "client" using "iphone_mux_recv()" or if it would be feasable to somehow adjust the mux_recv itself to know that there is still data left to be read.
I have not checked whether libiphone should/does also spread data among packets or if sending large plists can work.
Comments and changes to this ticket
-
Martin S. April 18th, 2009 @ 05:56 PM
Here is a patch for lockdown, however I am not sure if the SSL stuff will work with the buffer receive loop as good as iphone_mux_recv, thus I would not accept it without verification by someone.
-
Martin S. April 22nd, 2009 @ 06:34 PM
Patch below is now fixed and replaces both earlier patches.
As explained this makes receive of bigger plists work for MobileSync which is required if one has a lot of contacts to sync.
-
Matt Colyer April 24th, 2009 @ 02:05 AM
- State changed from new to resolved
(from [fa8424a5da3d9e745541834048a5bbbfd5427a5c]) Fix receive of plists larger than a packet for lockdown and MobileSync
[#35 state:resolved]
Signed-off-by: Matt Colyer matt@colyer.name http://github.com/MattColyer/lib...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A project around supporting the iPhone in Linux.
See http://libimobiledevice.org
People watching this ticket
Attachments
Referenced by
- 6 Implement one-way contact / calendar syncing It depends on #35 as the sync data can be quite big if yo...
- 6 Implement one-way contact / calendar syncing This is quite awesome. I would love to have the protocol ...
- 35 [PATCH] Fix receive of plists larger than a packet [#35 state:resolved]