mime: implement encoders.

curl_mime_encoder() is operational and documented.
curl tool -F option is extended with ";encoder=".
curl tool --libcurl option generates calls to curl_mime_encoder().
New encoder tests 648 & 649.
Test 1404 extended with an encoder specification.
This commit is contained in:
Patrick Monnerat 2017-09-05 17:11:59 +01:00
parent 3bbe894fd2
commit 63ef436ea1
12 changed files with 809 additions and 45 deletions

View file

@ -506,6 +506,14 @@ static CURLcode libcurl_generate_mime(curl_mime *mime, int *mimeno)
break;
}
if(part->encoder) {
Curl_safefree(escaped);
escaped = c_escape(part->encoder->name, CURL_ZERO_TERMINATED);
if(!escaped)
return CURLE_OUT_OF_MEMORY;
CODE2("curl_mime_encoder(part%d, \"%s\");", *mimeno, escaped);
}
if(filename) {
Curl_safefree(escaped);
escaped = c_escape(filename, CURL_ZERO_TERMINATED);