Closed
Conversation
The checks for a connection being "too long idle" or "too old" where rounding down the elapsed time to seconds before comparing to the configured max values. This caused connections to be reused for up to 999ms longer than intended. Change the compares to scale the configured seconds up to ms, so connection will properly be "too old" 1 ms after the coonfigured values. Fixes sporadic failures of test1542 on platforms where "sleep(2)" returnes before 2 full seconds on the internal clock where passed. Reporter: Christian Weisgerber via curl-library mailing list
bagder
reviewed
Jun 10, 2025
Member
|
We can fix these by capping the values already in |
Contributor
Author
Maybe make the internal fields a |
bagder
reviewed
Jun 10, 2025
…lpers which cap values the same way between second and ms variants.
Contributor
Author
|
A little bit broader brush stroke in this PR. Have a common handling of most timeout values in setopt and change the timeout vars to Interestingly, there are platforms where |
bagder
approved these changes
Jun 11, 2025
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
The checks for a connection being "too long idle" or "too old" where rounding down the elapsed time to seconds before comparing to the configured max values. This caused connections to be reused for up to 999ms longer than intended. Change the compares to scale the configured seconds up to ms, so connection will properly be "too old" 1 ms after the coonfigured values. Fixes sporadic failures of test1542 on platforms where "sleep(2)" returnes before 2 full seconds on the internal clock where passed. Reported-by: Christian Weisgerber URL: https://curl.se/mail/lib-2025-06/0004.html Closes curl#17571
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change the internal timeout fields to type
timediff_tand check validity when setting the option with common helper functions for these timeouts. Cap too large values silently toTIMEDIFF_T_MAX.The checks for a connection being "too long idle" or "too old" were rounding down the elapsed time to seconds before comparing to the configured max values. This caused connections to be reused for up to 999ms longer than intended.
Fixes sporadic failures of test1542 on platforms where "sleep(2)" returnes before 2 full seconds on the internal clock had passed.
Reporter: Christian Weisgerber via curl-library mailing list