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 Nov 5, 2024
1 parent f459eba commit a4a1cd3
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 > 2500 ) // wait 2.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 a4a1cd3

Please sign in to comment.