Skip to content

multi: return the error from curl_multi_socket_all - #23549

Closed
Marti2203 wants to merge 1 commit into
curl:masterfrom
Marti2203:multi-socket-all-error
Closed

Marti2203 wants to merge 1 commit into
curl:masterfrom
Marti2203:multi-socket-all-error

Conversation

@Marti2203

Copy link
Copy Markdown
Contributor

When multi_perform() fails, for example because the timer callback returns an error, curl_multi_socket_all() overwrites the error with the result of Curl_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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@bagder bagder closed this in 4c0e5e0 Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants