diff options
author | Josh Gao <jmgao@google.com> | 2017-05-02 15:01:09 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-05-03 12:32:39 -0700 |
commit | ef3d343254405cc360b4df843c6e4a843c335012 (patch) | |
tree | c6bc56796e85122ec28e989067efbb2ff0166c60 /debuggerd/handler/debuggerd_handler.cpp | |
parent | 483d2f9a59bf4a5130e0a79306f30c25f675812c (diff) |
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
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
0 files changed, 0 insertions, 0 deletions