Closed
Description
What is going on
curl_multi_info_read returns msg->data.result == CURLE_WRITE_ERROR if received Content-Encoding is not supported.
I expected the following
I expect curl_multi_info_read to return CURLE_BAD_CONTENT_ENCODING.
Code
if(!conn->data->set.http_te_skip && !k->ignorebody) {
if(!conn->data->set.http_ce_skip && k->writer_stack)
result = Curl_unencode_write(conn, k->writer_stack, datap, piece);
else
result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, piece);
if(result)
return CHUNKE_WRITE_ERROR;
}
http_chunks.c 194-202
Curl_unencode_write returns CURLE_BAD_CONTENT_ENCODING and then it is being shadowed by CHUNKE_WRITE_ERROR which later is turning into CURLE_WRITE_ERROR.
curl/libcurl version
curl 7.65.3-DEV (x86_64-pc-linux-gnu) libcurl/7.65.3-DEV OpenSSL/1.1.1 zlib/1.2.11
operating system
Ubuntu 18.04.3 LTS
Metadata
Metadata
Assignees
Labels
No labels
Activity
bagder commentedon Sep 10, 2019
Do you have an example of how to reproduce this?
PersDep commentedon Sep 10, 2019
Here is a test based on tests/libtest/lib597.c
You can run it with URL == https://www.programcreek.com/python/example/103281/brotli.compress to see the described behavior. Also curl has to be configured with
--without-brotli
flagbagder commentedon Sep 10, 2019
Thank you, reproduced perfectly. Now I just need to figure out how to deal with this the best way...
bagder commentedon Oct 1, 2019
Here's a stand alone version to repro: debug-4310.c
chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING error
httpc: handle bad Content-Encoding with curl-7.67.0+
httpc: handle bad Content-Encoding with curl-7.67.0+
httpc: handle bad Content-Encoding with curl-7.67.0+
httpc: handle bad Content-Encoding with curl-7.67.0+