diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2017-09-05 17:11:59 +0100 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2017-09-05 17:55:51 +0100 |
commit | 63ef436ea15dd93343a2040ffb7c3bb2c9681b87 (patch) | |
tree | 3d60cf99bb9f54b2511a711b7f2fb4dad15136fd /src/tool_setopt.c | |
parent | 3bbe894fd26114e6835c697008b61beeffd084bf (diff) | |
download | curl-63ef436ea15dd93343a2040ffb7c3bb2c9681b87.tar.gz |
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.
Diffstat (limited to 'src/tool_setopt.c')
-rw-r--r-- | src/tool_setopt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tool_setopt.c b/src/tool_setopt.c index b0f319814..635304a8f 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -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); |