From dbcced8e32b50c068ac297106f0502ee200a1ebd Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Sun, 5 Nov 2017 15:09:48 +0100 Subject: 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 --- lib/url.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 374ac6cfa..aeb0c9027 100644 --- a/lib/url.c +++ b/lib/url.c @@ -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: -- cgit v1.2.3