diff options
author | Mike Lockwood <lockwood@google.com> | 2010-10-11 14:37:06 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-11 14:37:06 -0700 |
commit | 25cf4fd9c7bf5110b44af4af86fb5e630bca2e5f (patch) | |
tree | 1d50430c0d12b901392e1e3e2fc2b78edb2e7048 /media | |
parent | 3e6fee857a317d35b4861b8bb24a2d3e5e3e6fc2 (diff) | |
parent | db7743128b82d4c22f5b4d3b634d5232a6af7564 (diff) | |
download | frameworks_base-25cf4fd9c7bf5110b44af4af86fb5e630bca2e5f.zip frameworks_base-25cf4fd9c7bf5110b44af4af86fb5e630bca2e5f.tar.gz frameworks_base-25cf4fd9c7bf5110b44af4af86fb5e630bca2e5f.tar.bz2 |
Merge "MTP: Include size of 12 byte header in packet size for GetObject data packet"
Diffstat (limited to 'media')
-rw-r--r-- | media/mtp/MtpServer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp index 84a3e2c..f74f395 100644 --- a/media/mtp/MtpServer.cpp +++ b/media/mtp/MtpServer.cpp @@ -163,6 +163,7 @@ void MtpServer::run() { mData.setOperationCode(operation); mData.setTransactionID(transaction); LOGV("sending data:"); + mData.dump(); ret = mData.write(fd); if (ret < 0) { LOGE("request write returned %d, errno: %d", ret, errno); @@ -177,6 +178,7 @@ void MtpServer::run() { mResponse.setTransactionID(transaction); LOGV("sending response %04X", mResponse.getResponseCode()); ret = mResponse.write(fd); + mResponse.dump(); if (ret < 0) { LOGE("request write returned %d, errno: %d", ret, errno); if (errno == ECANCELED) { @@ -546,7 +548,7 @@ MtpResponseCode MtpServer::doGetObject() { // send data header mData.setOperationCode(mRequest.getOperationCode()); mData.setTransactionID(mRequest.getTransactionID()); - mData.writeDataHeader(mFD, fileLength); + mData.writeDataHeader(mFD, fileLength + MTP_CONTAINER_HEADER_SIZE); // then transfer the file int ret = ioctl(mFD, MTP_SEND_FILE, (unsigned long)&mfr); |