mirror of
https://github.com/curl/curl.git
synced 2026-07-27 08:27:19 +03:00
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:
parent
3bbe894fd2
commit
63ef436ea1
12 changed files with 809 additions and 45 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue