easy: fix curl_easy_upkeep for shared connection caches #12677
Closed
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.
This change allows curl_easy_upkeep to be effective on easy handles that are using a shared connection cache, either from a user created shared connection cache or a user created multi which has its own shared connection cache.
Prior to this change curl_easy_upkeep would upkeep the connection cache for the easy handle only if that cache was from the multi owned by the easy handle (ie curl_easy_perform was previously called and there's a connection cache exclusive to the easy handle in
data->multi_easy->conn_cache).
Ref: https://curl.se/mail/lib-2024-01/0016.html
Closes #xxxx
It's probably a matter of perspective whether this is a bug or not. I didn't find anything to indicate that the function wasn't intended to work with shared connection caches.
Note this change will allow calling on an easy handle that is part of a user created multi, therefore a user of that interface might use this function and not expect it to block? It's unclear to me whether or not the function could actually block.
/cc @maxdymond