Skip to content

Commit

Permalink
increase the cancel wait time between thread
Browse files Browse the repository at this point in the history
On our machine, the original timeout is insufficient, causing the USB gadget
to close when attempting to cancel a file transfer. We've extended the timeout
with additional redundancy to prevent this from happening.

Signed-off-by: gujie <jie.gu@leica-geosystems.com.cn>
  • Loading branch information
gujie-leica committed Sep 5, 2024
1 parent 149efca commit 5446f8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static void handle_setup_request(usb_gadget * ctx, struct usb_ctrlrequest* setup
while( mtp_context->cancel_req )
{
// Still Waiting the end of the current transfer...
if( cnt > 500 )
if( cnt > 5000 ) // wait 5s max for cancel_req from the io_thread
{
// Still blocked... Killing the link
PRINT_DEBUG("MTP_REQ_CANCEL : Stalled ... Killing the link...");
Expand Down

0 comments on commit 5446f8d

Please sign in to comment.