meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.33k stars 510 forks source link

How to cancel login process? #2625

Closed oviradoi closed 2 years ago

oviradoi commented 2 years ago

I have noticed that if the login process hangs (due to a misconfigured proxy server), the Mega API client will retry the login using an exponential back-off.

Is there any way to configure the maximum number of retries of the login process? Or the values of the exponential back-off used for the login request?

Is there any way to cancel the login process after it has started? I have access to the MegaRequest object from the onRequestTemporaryError method, but I don't see any api->cancelLogin or request->cancel method.

mattw-mega commented 2 years ago

That is how it works for all request batches, not just one containing Login. You do have the option to delete the MegaApi of course, and start from scratch.

oviradoi commented 2 years ago

Thanks for the reply. It seems that deleting the MegaApi object is the only way to cancel all the requests, and this is the method I used in the end.