Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions device-src/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2653,19 +2653,29 @@ perform_request(S3Handle *hdl,
goto curl_error;
}
#endif

if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPGET, curlopt_httpget)))
goto curl_error;
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, curlopt_upload)))
goto curl_error;
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POST, curlopt_post)))
goto curl_error;
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOBODY, curlopt_nobody)))
goto curl_error;
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST,
curlopt_customrequest)))
goto curl_error;

// set only required http method
// libcurl seems to behave strangely in 7.29 > i.e. 7.81
if(curlopt_httpget) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPGET, curlopt_httpget)))
goto curl_error;
}
if(curlopt_upload) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, curlopt_upload)))
goto curl_error;
}
if(curlopt_post) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POST, curlopt_post)))
goto curl_error;
}
if(curlopt_nobody) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOBODY, curlopt_nobody)))
goto curl_error;
}
if(curlopt_customrequest) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST,
curlopt_customrequest)))
goto curl_error;
}

if (curlopt_upload || curlopt_post) {
if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, read_func)))
Expand Down