Skip to content

tool_operate: set stdin non-blocking unconditionally - #23081

Closed
bagder wants to merge 3 commits into
masterfrom
bagder/stdin-nonblock
Closed

bagder wants to merge 3 commits into
masterfrom
bagder/stdin-nonblock

Conversation

@bagder

@bagder bagder commented Sep 24, 2026

Copy link
Copy Markdown
Member

When doing TELNET:// transfers are read from stdin without having set an upload file, so set stdin non-blocking mode unconditionally to make it able to time-out correctly.

Update test 1548 to sit waiting on an idle stdin with telnet properly.

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

Four moderate portability, cleanup, and test-reliability issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Makes stdin non-blocking so TELNET transfers can time out while awaiting input.

Changes:

  • Enables non-blocking stdin for all transfers.
  • Updates test 1548 to exercise idle TELNET stdin.
File Review
src/​tool_operate.c Three moderate issues: stdin flags are not restored; native Windows stdin remains blocking; and EWOULDBLOCK is not handled alongside EAGAIN.
tests/​data/​test1548 Moderate issue: inherited stdin may be EOF, so the test does not reliably exercise blocking input.

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

Comment thread src/tool_operate.c
When doing TELNET:// transfers are read from stdin without having set an
upload file, so set stdin non-blocking mode unconditionally to make it
able to time-out correctly.

Update test 1548 to sit waiting on an idle stdin with telnet properly.
@bagder
bagder force-pushed the bagder/stdin-nonblock branch from cf9feee to 001f2dd Compare September 24, 2026 15:34
@bagder

bagder commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@vszakats these quiche problems were seen in #22988 as well. Should we really have merged that PR?

@bagder
bagder marked this pull request as ready for review September 24, 2026 15:43
@bagder bagder closed this in d745b13 Sep 24, 2026
@bagder
bagder deleted the bagder/stdin-nonblock branch September 24, 2026 22:06
jay added a commit that referenced this pull request Sep 29, 2026
This reverts commit d745b13.

Setting stdin as non-blocking unconditionally caused it to affect future
shell commands. There is probably a way to fix it but I think this needs
a rethink. For now we revert.

Ref: #23057
Ref: #23081

Reported-by: Daniel S. Roche
Researched-by: KayanoLiam@users.noreply.github.com

Fixes #23127
Closes #23144
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.

2 participants