diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2017-11-05 15:09:48 +0100 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2017-11-05 15:09:48 +0100 |
commit | dbcced8e32b50c068ac297106f0502ee200a1ebd (patch) | |
tree | 0fa1ce28f33ab968792e21264e9a9318807d9f9b /lib/url.c | |
parent | 462f3cac34c09b9c28b449258e71dc37171dc604 (diff) | |
download | curl-dbcced8e32b50c068ac297106f0502ee200a1ebd.tar.gz |
HTTP: support multiple Content-Encodings
This is implemented as an output streaming stack of unencoders, the last
calling the client write procedure.
New test 230 checks this feature.
Bug: https://github.com/curl/curl/pull/2002
Reported-By: Daniel Bankhead
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1011,9 +1011,17 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option, * */ argptr = va_arg(param, char *); - result = setstropt(&data->set.str[STRING_ENCODING], - (argptr && !*argptr)? - ALL_CONTENT_ENCODINGS: argptr); + if(argptr && !*argptr) { + argptr = Curl_all_content_encodings(); + if(!argptr) + result = CURLE_OUT_OF_MEMORY; + else { + result = setstropt(&data->set.str[STRING_ENCODING], argptr); + free(argptr); + } + } + else + result = setstropt(&data->set.str[STRING_ENCODING], argptr); break; case CURLOPT_TRANSFER_ENCODING: |