Skip to content

multi: split multi_runsingle into sub functions#20573

Closed
bagder wants to merge 4 commits intomasterfrom
bagder/multi-tidy
Closed

multi: split multi_runsingle into sub functions#20573
bagder wants to merge 4 commits intomasterfrom
bagder/multi-tidy

Conversation

@bagder
Copy link
Member

@bagder bagder commented Feb 12, 2026

To reduce complexity.

  • is_finished() checks if the individual transfer is done

  • handle_completed() is the logic that runs for a completed transfer

To reduce complexity.

- is_finished() checks if the individual transfer is done

- handle_completed() is the logic that runs for a completed
  transfer
@bagder bagder marked this pull request as ready for review February 12, 2026 15:51
@bagder bagder requested a review from Copilot February 12, 2026 15:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors multi_runsingle() in lib/multi.c by extracting completion/error-handling logic into dedicated helper functions to reduce complexity and improve readability.

Changes:

  • Extracted end-of-loop completion/error transition logic into is_finished()
  • Extracted completed-transfer message/callback handling into handle_completed()
  • Simplified multi_runsingle() by replacing large inline blocks with helper calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder
Copy link
Member Author

bagder commented Feb 12, 2026

augment review

@augmentcode
Copy link

augmentcode bot commented Feb 12, 2026

🤖 Augment PR Summary

Summary: This PR refactors the multi interface transfer state machine to reduce complexity in multi_runsingle().

Changes:

  • Extracted the “transfer finished?” / abort handling block into is_finished(), which may update state/connection cleanup and returns the (possibly updated) CURLcode.
  • Extracted the “completed transfer” bookkeeping and message dispatch into handle_completed().
  • Simplified multi_runsingle() by delegating completion/cleanup/message logic to these helpers while preserving the existing state transition flow.

Technical Notes: The refactor keeps the same completion path: errors can force MSTATE_COMPLETED, progress-callback aborts can transition to MSTATE_DONE/MSTATE_COMPLETED, and completed transfers move to MSTATE_MSGSENT with set bookkeeping updates.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder
Copy link
Member Author

bagder commented Feb 12, 2026

The fuzzer build now reports:

2026-02-12 16:06:59,118 - root - INFO - Base OS version is Ubuntu 24.04, but running in a different OS. Pivoting to Ubuntu 24.04 container.

docker: Error response from daemon: client version 1.41 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version.

@bagder bagder closed this in df6f3ae Feb 12, 2026
@bagder bagder deleted the bagder/multi-tidy branch February 12, 2026 21:34
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.

2 participants