summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Low <richard@wentnet.com>2008-02-16 11:13:23 +0000
committerRichard Low <richard@wentnet.com>2008-02-16 11:13:23 +0000
commita0eda1646adc3a75336fc56a3aacd2f391a76fb7 (patch)
tree618423933f48632a7d12cd6352b9389550a1ce92
parentf7d8df1798c483ca40f4b2c5ce685b788694ff02 (diff)
downloadlibmtp-a0eda1646adc3a75336fc56a3aacd2f391a76fb7.tar.gz
Comments
-rw-r--r--src/libusb-glue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libusb-glue.c b/src/libusb-glue.c
index 2d38b6f..a0292d2 100644
--- a/src/libusb-glue.c
+++ b/src/libusb-glue.c
@@ -1112,6 +1112,10 @@ ptp_usb_getresp (PTPParams* params, PTPContainer* resp)
/* read response, it should never be longer than sizeof(usbresp) */
ret = ptp_usb_getpacket(params, &usbresp, &rlen);
+ // Fix for bevahiour reported by Scott Snyder on Samsung YP-U3. The player
+ // sends a packet containing just zeroes of length 2 (up to 4 has been seen too)
+ // after a NULL packet when it should send the response. This code ignores
+ // such illegal packets.
while (ret==PTP_RC_OK && rlen<PTP_USB_BULK_HDR_LEN && usbresp.length==0) {
ptp_debug (params, "ptp_usb_getresp: detected short response "
"of %d bytes, expect problems! (re-reading "