Skip to content

Make _MultiHandle timeout timer non-repeatable #4858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2024

Conversation

lxbndr
Copy link
Contributor

@lxbndr lxbndr commented Dec 26, 2023

CURL documentation (https://curl.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html) explicitly says that the timer should be non-repeatable. We basically have to follow CURL requests for setting, resetting and disarming such timers.

Current logic eventually leaves a 1ms repeating timer forever, because CURL assumes it fires once, and may not ask us to remove it explicitly. Which is bad for app power consumption, I suppose.

Also, being used as request timeout trigger, this timer also has no sense to be repeated.

CURL documentation (https://curl.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html)
explicitly says that the timer should be one-time. We basically have to
follow CURL requests for setting, resetting and disarming such timers.

Current logic eventually leaves a 1ms repeating timer forever, because
CURL assumes it fires once, and may not ask us to remove it explicitly.

Also, being used as request timeout trigger, this timer also has no sense
to be repeated.
@lxbndr lxbndr changed the title Make _MultiHandle timeout timer non-repeatable Make _MultiHandle timeout timer non-repeatable Dec 26, 2023
@shahmishal shahmishal merged commit 7258a8d into swiftlang:main May 25, 2024
@lxbndr lxbndr deleted the readdle/urlsession-timer branch May 25, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants