mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 09:19:36 +01:00
libstore/filetransfer: Add HttpMethod::PUT
This got lost in f1968ea38e and
now we had incorrect logs that confused "downloading" when we were
in fact "uploading" things.
This commit is contained in:
parent
70176ed317
commit
ae49074548
4 changed files with 8 additions and 2 deletions
|
|
@ -394,9 +394,11 @@ struct curlFileTransfer : public FileTransfer
|
|||
if (request.method == HttpMethod::POST) {
|
||||
curl_easy_setopt(req, CURLOPT_POST, 1L);
|
||||
curl_easy_setopt(req, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t) request.data->length());
|
||||
} else {
|
||||
} else if (request.method == HttpMethod::PUT) {
|
||||
curl_easy_setopt(req, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(req, CURLOPT_INFILESIZE_LARGE, (curl_off_t) request.data->length());
|
||||
} else {
|
||||
unreachable();
|
||||
}
|
||||
curl_easy_setopt(req, CURLOPT_READFUNCTION, readCallbackWrapper);
|
||||
curl_easy_setopt(req, CURLOPT_READDATA, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue