Skip to content

Commit cce42ee

Browse files
committed
conditionally use separate bulk writes for sending object
fixes upload to samsung phones
1 parent a3204c8 commit cce42ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mtp/ptp/Session.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,12 @@ namespace mtp
314314
{
315315
DataRequest req(OperationCode::SendObject, transaction.Id);
316316
Container container(req, inputStream);
317-
_packeter.Write(std::make_shared<ByteArrayObjectInputStream>(container.Data), timeout);
318-
_packeter.Write(inputStream, timeout);
317+
if (_separateBulkWrites)
318+
{
319+
_packeter.Write(std::make_shared<ByteArrayObjectInputStream>(container.Data), timeout);
320+
_packeter.Write(inputStream, timeout);
321+
} else
322+
_packeter.Write(std::make_shared<JoinedObjectInputStream>(std::make_shared<ByteArrayObjectInputStream>(container.Data), inputStream), timeout);
319323
}
320324
ByteArray response;
321325
Get(transaction.Id, response);

0 commit comments

Comments
 (0)