Merge "MtpDevice: Handle zero length packets in readResponse()" into honeycomb-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
3ec9d06f07
@@ -819,6 +819,10 @@ MtpResponseCode MtpDevice::readResponse() {
|
||||
return mResponse.getResponseCode();
|
||||
}
|
||||
int ret = mResponse.read(mRequestIn1);
|
||||
// handle zero length packets, which might occur if the data transfer
|
||||
// ends on a packet boundary
|
||||
if (ret == 0)
|
||||
ret = mResponse.read(mRequestIn1);
|
||||
if (ret >= MTP_CONTAINER_HEADER_SIZE) {
|
||||
mResponse.dump();
|
||||
return mResponse.getResponseCode();
|
||||
|
||||
Reference in New Issue
Block a user