Skip to content
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

multi: round the timeout up to prevent early wakeups #11938

Closed
wants to merge 1 commit into from

Conversation

hwti
Copy link
Contributor

@hwti hwti commented Sep 25, 2023

Curl_timediff rounds down to the millisecond, so curl_multi_perform can be called too early, then we get a timeout of 0 and call it again.

The code already handled the case of timeouts which expired less than 1ms in the future.
By rounding up, we make sure we will never ask the platform to wake up too early.

lib/multi.c Outdated Show resolved Hide resolved
lib/timeval.h Outdated Show resolved Hide resolved
Curl_timediff rounds down to the millisecond, so curl_multi_perform can be called too early,
then we get a timeout of 0 and call it again.

The code already handled the case of timeouts which expired less than 1ms in the future.
By rounding up, we make sure we will never ask the platform to wake up too early.
@bagder bagder closed this in d39863d Sep 28, 2023
@bagder
Copy link
Member

bagder commented Sep 28, 2023

Thanks!

@hwti hwti deleted the early-wakeup branch October 11, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants