From 6a5de2790fac25c469393731300d0b4f11fa66f9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Feb 2017 19:56:45 +0000 Subject: [PATCH] use long timeout for DeleteObject --- mtp/ptp/Session.cpp | 4 ++-- mtp/ptp/Session.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mtp/ptp/Session.cpp b/mtp/ptp/Session.cpp index 8437055b..02e8929b 100644 --- a/mtp/ptp/Session.cpp +++ b/mtp/ptp/Session.cpp @@ -394,11 +394,11 @@ namespace mtp return Get(transaction.Id, timeout); } - void Session::DeleteObject(ObjectId objectId) + void Session::DeleteObject(ObjectId objectId, int timeout) { scoped_mutex_lock l(_mutex); Transaction transaction(this); - Send(OperationRequest(OperationCode::DeleteObject, transaction.Id, objectId.Id, 0)); + Send(OperationRequest(OperationCode::DeleteObject, transaction.Id, objectId.Id, 0), timeout); Get(transaction.Id); } diff --git a/mtp/ptp/Session.h b/mtp/ptp/Session.h index 2e243b43..52e5591b 100644 --- a/mtp/ptp/Session.h +++ b/mtp/ptp/Session.h @@ -98,7 +98,7 @@ namespace mtp ByteArray GetPartialObject(ObjectId objectId, u64 offset, u32 size); NewObjectInfo SendObjectInfo(const msg::ObjectInfo &objectInfo, StorageId storageId = AnyStorage, ObjectId parentObject = Device); void SendObject(const IObjectInputStreamPtr &inputStream, int timeout = LongTimeout); - void DeleteObject(ObjectId objectId); + void DeleteObject(ObjectId objectId, int timeout = LongTimeout); bool EditObjectSupported() const { return _editObjectSupported; }