Skip to content
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

curl_mime_data does not change Content-Length when change data after perform #1999

Closed
moteus opened this issue Oct 19, 2017 · 2 comments
Closed

Comments

@moteus
Copy link

@moteus moteus commented Oct 19, 2017

I did this

I create mime with simple text then I did perform and curl correcly send data.
After that I change data in text part but when I did perform again curl
send Content-Length for first data. If I change data without doing perform then
curl send correct Content-Length. This is my snippet on Lua, but I think
it quite easy to understand.

local easy = curl.easy()
local mime = easy:mime()

easy:setopt{
  url            = "http://127.0.0.1:7090/get";
  customrequest  = "GET";
  mimepost       = mime;
  writefunction  = function()end;
}

local part = mime:addpart()

part:data('1234567890')
easy:perform() -- here curl send Conten-Length: 136 (which is correct)

part:data('abcd')
easy:perform() -- here curl send same Conten-Length: 136 but data size is 130

I expected the following

I expected that curl send correct Content-Length

curl/libcurl version

libcurl/7.56.0 WinSSL

operating system

Windows 7 x64

@monnerat
Copy link
Contributor

@monnerat monnerat commented Oct 20, 2017

Many tanks for the report: the bug is confirmed.
I will produce a fix and a test case in the next hours.

@monnerat
Copy link
Contributor

@monnerat monnerat commented Oct 20, 2017

Fix pushed: cea27d3
Test for this case: 8351ab4

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants