Skip to content

Commit

Permalink
conditionally use separate bulk writes for sending object
Browse files Browse the repository at this point in the history
fixes upload to samsung phones
  • Loading branch information
whoozle committed Dec 29, 2020
1 parent a3204c8 commit cce42ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mtp/ptp/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,12 @@ namespace mtp
{
DataRequest req(OperationCode::SendObject, transaction.Id);
Container container(req, inputStream);
_packeter.Write(std::make_shared<ByteArrayObjectInputStream>(container.Data), timeout);
_packeter.Write(inputStream, timeout);
if (_separateBulkWrites)
{
_packeter.Write(std::make_shared<ByteArrayObjectInputStream>(container.Data), timeout);
_packeter.Write(inputStream, timeout);
} else
_packeter.Write(std::make_shared<JoinedObjectInputStream>(std::make_shared<ByteArrayObjectInputStream>(container.Data), inputStream), timeout);
}
ByteArray response;
Get(transaction.Id, response);
Expand Down

0 comments on commit cce42ee

Please sign in to comment.