Skip to content

multi: is_finished() fix - #23295

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:multi-is-finished-fix
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:multi-is-finished-fix

Conversation

@icing

@icing icing commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

When the progress callback errors on a not comppleted transfer, the transfer state entered COMPLETED right away and not DONE. This led to cleanup actions on the transfer/connection to not run.

Only go to MSTATE_DONE in this case.

reported-by: anthropic

When the progress callback errors on a not comppleted transfer, the
transfer state entered COMPLETED right away and not DONE. This led
to cleanup actions on the transfer/connection to not run.

Only go to MSTATE_DONE in this case.

reported-by: anthropic
@icing
icing requested a review from bagder October 7, 2026 08:57

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.

Copilot review overview

🟢 Approval recommended

The corrected transition preserves cleanup while retaining the callback error result.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes multi-transfer cleanup when a progress callback aborts an incomplete transfer.

Changes:

  • Routes aborted transfers through MSTATE_DONE so multi_done() runs.
  • Adds an assertion that completed transfers have detached their connection.
File Description
lib/​multi.c Corrects state transitions and verifies connection cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bagder bagder closed this in 11d0b20 Oct 7, 2026
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Nov 18, 2026
When the progress callback errors on a not comppleted transfer, the
transfer state entered COMPLETED right away and not DONE. This led
to cleanup actions on the transfer/connection to not run.

Only go to MSTATE_DONE in this case.

Reported-by: Anthropic
Closes curl#23295

Backport notes:

- Dropped the DEBUGASSERT in mstate_enter_completed(), which the
  release lacks.

(cherry picked from commit 11d0b20)
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.

3 participants