adb: use the actual wMaxPacketSize for usb endpoints.
Previously, adb was assuming a fixed maximum packet size of 1024 bytes (the value for an endpoint connected via USB 3.0). When connected to an endpoint that has an actual maximum packet size of 512 bytes (i.e. every single device over USB 2.0), the following could occur: device sends amessage with 512 byte payload client reads amessage client tries to read payload with a length of 1024 In this scenario, the kernel will block, waiting for an additional packet which won't arrive until something else gets sent across the wire, which will result in the previous read failing, and the new packet being dropped. Bug: http://b/37783561 Test: python test_device.py on linux/darwin, with native/libusb Change-Id: I556f5344945e22dd1533b076f662a97eea24628e
Loading
Please register or sign in to comment