mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
transfer: init the infilesize from the postfields...
... with a strlen() if no size was set, and do this in the pretransfer function so that the info is set early. Otherwise, the default strlen() done on the POSTFIELDS data never sets state.infilesize. Reported-by: Vincas Razma Bug: #1294
This commit is contained in:
parent
35682764a9
commit
e54db1b053
2 changed files with 7 additions and 9 deletions
|
|
@ -1309,8 +1309,11 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
|||
|
||||
if(data->set.httpreq == HTTPREQ_PUT)
|
||||
data->state.infilesize = data->set.filesize;
|
||||
else
|
||||
else {
|
||||
data->state.infilesize = data->set.postfieldsize;
|
||||
if(data->set.postfields && (data->state.infilesize == -1))
|
||||
data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
|
||||
}
|
||||
|
||||
/* If there is a list of cookie files to read, do it now! */
|
||||
if(data->change.cookielist)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue