-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Ranged PUT request with CURLOPT_RESUME_FROM does not work #8969
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
Comments
HTTP does not support range "uploads" with PUT or POST. You can do an implementation, but then you need a server side to agree with the specific method you decide to use from the client and it will not be a generic solution with any HTTP client/server combination. |
Okay, I understand that. Otherwise, that should probably be adjusted in the docs:
|
What's the request you want it to send, exactly? Since you're asking for a feature HTTP does not provide it isn't clear to me. |
I want to send a request like it is described here.
|
To upload 4 bytes with a custom
It creates this request:
|
Ok, many thanks for the answer 👍 |
You have to use CURLOPT_UPLOAD as discussed in the previous e-mail. CURLOPT_CUSTOMREQUEST, "PUT" will not do what you expect:
Regardless maybe I was wrong in the e-mail. You'd have to have a custom read function to stop reading, I think, rather than rely on the default read function in libcurl which will keep reading past the part you want to send. |
The e-mail link in the advice contains instructions that are prone to error. We need an example that works and can demonstrate how to properly perform a ranged upload, and then we can refer to that example instead. Bug: curl#8969 Reported-by: Simon Berger Closes #xxxx
With @jay's updated man page landed, I think we can close this issue. |
I did this
I wanted to do a ranged put request as described here.
I expected the following
Execute a PUT request to the given server url with an upload range.
Actual behavior
No HTTP request is executed (checked with Wireshark) and instead, the execution of the program is stuck at
curl_easy_perform(curl_->handle)
. The request is only executed if I comment / removecurl_easy_setopt(curl_->handle, CURLOPT_RESUME_FROM_LARGE, resume_from
which results in disabling the resume from option.Note: The request is also executed if I remove the body.
What I have tried to fix the problem
https://github.com/curl/curl/blob/c9b60f005358a364cbcddbebd8d12593acffdd84/lib/http.c#L2856-2908
curl/libcurl version
curl-7.83.1
Same problem with curl-7.81.0 which I have used before i encountered the problem.
operating system
Ubuntu 20.04.4 LTS
Linux Simon-PC 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: