Repository navigation
Conversation
When multi_perform() failed, for example because the timer callback returned an error, curl_multi_socket_all() overwrote the error with the result of reassessing the transfers and returned CURLM_OK, while curl_multi_socket_action() returned CURLM_ABORTED_BY_CALLBACK for the same failure. Extend unit test 3230 to check it.
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves existing reassessment behavior, includes a targeted regression test, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR fixes error propagation in curl_multi_socket_all() while preserving event reassessment for active transfers.
Changes:
- Preserve the first error instead of overwriting it with the reassessment result.
- Extend unit test 3230 to verify that a failing timer callback returns
CURLM_ABORTED_BY_CALLBACK.
| File | Description |
|---|---|
| tests/unit/unit3230.c | Adds regression coverage for timer callback failure through curl_multi_socket_all(). |
| lib/multi.c | Preserves the multi_perform() error while still reassessing transfer events. |
Review effort: Balanced
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.
When
multi_perform()fails, for example because the timer callback returns an error,curl_multi_socket_all()overwrites the error with the result ofCurl_multi_ev_assess_xfer_bset()and returns CURLM_OK.curl_multi_socket_action()returns CURLM_ABORTED_BY_CALLBACK for the same failure.This keeps reassessing the transfers but returns the first error.
Unit test 3230 now also calls
curl_multi_socket_all()with a failing timer callback; it fails without the change.