diff options
author | Jihoon Jung <jh8801.jung@samsung.com> | 2024-02-19 10:20:56 +0900 |
---|---|---|
committer | Jihoon Jung <jh8801.jung@samsung.com> | 2024-02-19 10:20:56 +0900 |
commit | 249896cdab8eb09937c7deb52184df2000ec85f3 (patch) | |
tree | 50c94d96d63b7512dc8eb35495a4e2a1793e59d3 | |
parent | f78f2b82bf543ecbda00a12866749760b8d87553 (diff) | |
download | libmtp-accepted/tizen/unified/20240219.160410.tar.gz libmtp-accepted/tizen/unified/20240219.160410.tar.bz2 libmtp-accepted/tizen/unified/20240219.160410.zip |
Change timeout value to 5sec when get objecttizen_9.0_m2_releaseaccepted/tizen/unified/x/20240220.150028accepted/tizen/unified/toolchain/20240311.070028accepted/tizen/unified/dev/20240620.010834accepted/tizen/unified/20240219.160410accepted/tizen/9.0/unified/20241030.232239tizen_9.0tizenaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: Ie3fee239ae82b50481c910cb834e3114179c0ed5
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r-- | packaging/libmtp.spec | 2 | ||||
-rw-r--r-- | src/libmtp.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/packaging/libmtp.spec b/packaging/libmtp.spec index 7558ea4..a33953a 100644 --- a/packaging/libmtp.spec +++ b/packaging/libmtp.spec @@ -3,7 +3,7 @@ Name: libmtp Summary: Library for media transfer protocol (mtp) Version: 1.1.11 -Release: 15 +Release: 16 Group: Network & Connectivity/Other License: LGPL-2.1 Source0: libmtp-%{version}.tar.gz diff --git a/src/libmtp.c b/src/libmtp.c index 30917c4..4a139d2 100644 --- a/src/libmtp.c +++ b/src/libmtp.c @@ -5247,13 +5247,22 @@ int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t *device, PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo; PTPObject *ob; + int oldtimeout; + + get_usb_device_timeout(ptp_usb, &oldtimeout); + set_usb_device_timeout(ptp_usb, 5000); + + LIBMTP_INFO("priv set timeout value : %d, now, set timeout value to 5 sec", oldtimeout); + ret = ptp_object_want (params, id, PTPOBJECT_OBJECTINFO_LOADED, &ob); if (ret != PTP_RC_OK) { add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Get_File_To_File_Descriptor(): Could not get object info."); + set_usb_device_timeout(ptp_usb, oldtimeout); return -1; } if (ob->oi.ObjectFormat == PTP_OFC_Association) { add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Get_File_To_File_Descriptor(): Bad object format."); + set_usb_device_timeout(ptp_usb, oldtimeout); return -1; } @@ -5271,6 +5280,8 @@ int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t *device, ptp_usb->current_transfer_callback = NULL; ptp_usb->current_transfer_callback_data = NULL; + set_usb_device_timeout(ptp_usb, oldtimeout); + if (ret == PTP_ERROR_CANCEL) { add_error_to_errorstack(device, LIBMTP_ERROR_CANCELLED, "LIBMTP_Get_File_From_File_Descriptor(): Cancelled transfer."); return -1; |