-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl tries to read from stdin when POSTing with -C #11081
Comments
Actually it might be useful to PUT some partial data to a server, like |
There is no standard for doing "partial" uploads with HTTP PUT. |
|
The code assumes that such a resume is wanting to continue an upload using the read callback, and since POSTFIELDS is done without callback libcurl will just misbehave. This combo will make the transfer fail with CURLE_BAD_FUNCTION_ARGUMENT with an explanation in the error message. Reported-by: Smackd0wn on github Fixes #11081
libcurl assumes that a --continue-at resumption is done to continue an upload using the read callback and neither --data nor --form use that and thus won't do what the user wants. Whatever the user wants with this strange combination. Add test 426 to verify. Reported-by: Smackd0wn on github Fixes #11081
I see. Thank you for the fix! |
libcurl assumes that a --continue-at resumption is done to continue an upload using the read callback and neither --data nor --form use that and thus won't do what the user wants. Whatever the user wants with this strange combination. Add test 426 to verify. Reported-by: Smackd0wn on github Fixes #11081 Closes #11083
The code assumes that such a resume is wanting to continue an upload using the read callback, and since POSTFIELDS is done without callback libcurl will just misbehave. This combo will make the transfer fail with CURLE_BAD_FUNCTION_ARGUMENT with an explanation in the error message. Reported-by: Smackd0wn on github Fixes curl#11081 Closes curl#11083
libcurl assumes that a --continue-at resumption is done to continue an upload using the read callback and neither --data nor --form use that and thus won't do what the user wants. Whatever the user wants with this strange combination. Add test 426 to verify. Reported-by: Smackd0wn on github Fixes curl#11081 Closes curl#11083
I did this
curl -v httpbin.org/post --data foobar -C 3
I expected the following
Not sure what to expect (POST data "bar", maybe?), but surely not the current behavior:
and now it blocks forever, because it tries to read from stdin, seen from the
strace
logNow if I feed some data into stdin, say
yes | curl -v httpbin.org/post --data foobar -C 3
, curl will POST the string"foo"
, not"bar"
or"y\ny"
.curl/libcurl version
curl 8.0.1 (x86_64-pc-linux-gnu) libcurl/8.0.1 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.10.0 nghttp2/1.51.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
operating system
Linux arch 5.15.86-1-lts #1 SMP Sun, 01 Jan 2023 16:03:00 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: