curl: make --libcurl show binary posts correctly

Reported-by: Stephan Mühlstrasser
Fixes #6031
Closes #6032
This commit is contained in:
Daniel Stenberg 2020-10-01 22:59:30 +02:00
parent 9a13f7c2a7
commit 3997b3e2a4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 41 additions and 24 deletions

View file

@ -320,8 +320,10 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
if(S_ISREG(fileinfo.st_mode))
uploadfilesize = fileinfo.st_size;
if(uploadfilesize != -1)
if(uploadfilesize != -1) {
struct OperationConfig *config = per->config; /* for the macro below */
my_setopt(per->curl, CURLOPT_INFILESIZE_LARGE, uploadfilesize);
}
per->input.fd = per->infd;
}
return result;