Merge "adb: split up reads longer than 16k."
am: 56d7d4e85f
* commit '56d7d4e85f41ddeea5ca256e5a9c05f73b2f40f0':
adb: split up reads longer than 16k.
This commit is contained in:
commit
bf2c482b56
1 changed files with 2 additions and 1 deletions
|
@ -481,7 +481,8 @@ static int usb_ffs_read(usb_handle* h, void* data, int len) {
|
|||
|
||||
char* buf = static_cast<char*>(data);
|
||||
while (len > 0) {
|
||||
int n = adb_read(h->bulk_out, buf, len);
|
||||
int read_len = (len > 16384) ? 16384 : len;
|
||||
int n = adb_read(h->bulk_out, buf, read_len);
|
||||
if (n < 0) {
|
||||
D("ERROR: fd = %d, n = %d: %s", h->bulk_out, n, strerror(errno));
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue