From: <mar...@us...> - 2007-09-13 16:32:16
|
Revision: 10686 http://gphoto.svn.sourceforge.net/gphoto/?rev=10686&view=rev Author: marcusmeissner Date: 2007-09-13 09:32:18 -0700 (Thu, 13 Sep 2007) Log Message: ----------- more upload cancellation fixes. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/usb.c Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2007-09-13 16:28:22 UTC (rev 10685) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2007-09-13 16:32:18 UTC (rev 10686) @@ -3353,12 +3353,17 @@ CPR (context, ptp_ek_sendfileobject_from_handler (params, &handler, intsize)); ptp_exit_camerafile_handler (&handler); } else if (ptp_operation_issupported(params, PTP_OC_SendObjectInfo)) { + uint16_t ret; PTPDataHandler handler; + CPR (context, ptp_sendobjectinfo (params, &storage, &parent, &handle, &oi)); ptp_init_camerafile_handler (&handler, file); - CPR (context, ptp_sendobject_from_handler (params, &handler, intsize)); + ret = ptp_sendobject_from_handler (params, &handler, intsize); ptp_exit_camerafile_handler (&handler); + if (ret == PTP_ERROR_CANCEL) + return (GP_ERROR_CANCEL); + CPR (context, ret); } else { GP_DEBUG ("The device does not support uploading files!"); return GP_ERROR_NOT_SUPPORTED; Modified: trunk/libgphoto2/camlibs/ptp2/usb.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/usb.c 2007-09-13 16:28:22 UTC (rev 10685) +++ trunk/libgphoto2/camlibs/ptp2/usb.c 2007-09-13 16:32:18 UTC (rev 10686) @@ -174,7 +174,7 @@ gp_context_progress_update (context, progressid, written/CONTEXT_BLOCK_SIZE); #if 0 /* Does not work this way... Hmm. */ if (gp_context_cancel(context) == GP_CONTEXT_FEEDBACK_CANCEL) { - ret = ptp_usb_control_cancel_request(params,dtoh32(usbdata.trans_id)); + ret = ptp_usb_control_cancel_request (params,ptp->Transaction_ID); if (ret == PTP_RC_OK) ret = PTP_ERROR_CANCEL; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |