Skip to content

docs: document and align the blocking post-transfer and shutdown waits - #23006

Open
aeroyorch wants to merge 1 commit into
curl:masterfrom
aeroyorch:docs-multi-blocking-align
Open

aeroyorch wants to merge 1 commit into
curl:masterfrom
aeroyorch:docs-multi-blocking-align

Conversation

@aeroyorch

Copy link
Copy Markdown
Contributor

I started looking into this because of blocking behaviour I hit doing SFTP
transfers async, mainly on disconnect and at the end of a transfer.
While digging I found the "More non-blocking" section in docs/TODO.md, and
noticed that it and the BLOCKING section in libcurl-multi(3) do not say the
same thing. I took the chance to look at the other protocols as well, and the
two lists seem out of alignment.

Below a summary:

Post-transfer, through the done handler (multi_done(), lib/multi.c:717)

Protocol Blocking call
FTP getftpresponse() via ftp_done_control_reply() (lib/ftp.c:3752)
IMAP imap_block_statemach(..., FALSE) (lib/imap.c:2036)
SMTP smtp_block_statemach(..., FALSE) (lib/smtp.c:1747)
SCP/SFTP (libssh2) ssh_block_statemach(..., FALSE) (lib/vssh/libssh2.c:3619)
SCP/SFTP (libssh) myssh_block_statemach(..., FALSE) (lib/vssh/libssh.c:2758)

TODO.md already lists this one, but only for SFTP, SMTP and FTP.

On disconnect, through the disconnect handler (lib/cshutdn.c:125)

Protocol Blocking call
FTP ftp_quit() -> ftp_block_statemach() (lib/ftp.c:4311)
IMAP imap_block_statemach(..., TRUE) (lib/imap.c:2214)
POP3 pop3_block_statemach(..., TRUE) (lib/pop3.c:1626)
SMTP smtp_block_statemach(..., TRUE) (lib/smtp.c:1922)
SCP/SFTP (libssh2) ssh_block_statemach(..., TRUE) (lib/vssh/libssh2.c:3598, :3771)
SCP/SFTP (libssh) myssh_block_statemach(..., TRUE) (lib/vssh/libssh.c:2741, :2917)

TODO.md does not mention this one at all.

I came to this from the SFTP side, and traced the other protocols by reading the code, so very appreciated if reviewers more familiar with those could crosscheck that part.

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

🟡 Changes recommended

The shutdown wording inaccurately implies that every listed protocol waits for server acknowledgement.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Aligns documentation of blocking post-transfer and shutdown behavior across protocols.

Changes:

  • Expands affected protocol lists.
  • Documents blocking disconnect handlers and cross-references the multi interface guide.
File Description
docs/​TODO.md Updates known blocking operations.
docs/​libcurl/​libcurl-multi.md Expands multi-interface blocking restrictions.

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

Comment thread docs/libcurl/libcurl-multi.md Outdated
@aeroyorch
aeroyorch force-pushed the docs-multi-blocking-align branch 2 times, most recently from 64e7647 to 75a5e1e Compare September 22, 2026 15:19
@aeroyorch
aeroyorch requested a review from bagder September 28, 2026 14:11
@aeroyorch
aeroyorch force-pushed the docs-multi-blocking-align branch from 75a5e1e to fb5f6fe Compare September 28, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants