← Commit list

d745b13cad

Daniel Stenberg
Daniel Stenberg
2026-09-25
SUCCESS Duration: 389s

Subject

tool_operate: set stdin non-blocking unconditionally

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

docs/KNOWN_BUGS.md+7 -0
@@ -439,6 +439,13 @@ then subsequently fails anyway if that was actually in use.
[curl issue 8112](https://github.com/curl/curl/issues/8112)
+## Stdin is not non-blocking on Windows
+
+The telnet handler reads data from stdin by default without needing to
+specify that on the command line, but since Windows is special, reading
+from stdin is not done in a non-blocking manner, meaning that curl might
+block waiting for input without triggering the timeout.
+
# HTTP/2
## HTTP/2 prior knowledge over proxy
src/tool_operate.c+2 -5
@@ -1221,11 +1221,6 @@ static void check_stdin_upload(struct OperationConfig *config,
else
per->infd = (int)f;
#endif
- if(curlx_nonblock((curl_socket_t)per->infd, TRUE) < 0) {
- char errbuf[STRERROR_LEN];
- warnf("fcntl failed on fd=%d: %s", per->infd,
- curlx_strerror(errno, errbuf, sizeof(errbuf)));
- }
}
}
@@ -2360,6 +2355,8 @@ static CURLcode run_all_transfers(CURLSH *share,
bool orig_noprogress = (bool)global->noprogress;
bool orig_isatty = (bool)global->isatty;
struct per_transfer *per;
+ (void)curlx_nonblock((curl_socket_t)STDIN_FILENO, TRUE);
+ /* fail silently */
/* Time to actually do the transfers */
if(!result) {
tests/data/test1548+0 -4
@@ -23,10 +23,6 @@ telnet
<name>
TELNET read stdin without upload file
</name>
-<stdin>
-GET /we/want/%TESTNUMBER HTTP/1.0
-
-</stdin>
<command>
-m 1 telnet://%HOSTIP:%HTTPPORT
</command>