Skip to content

CURLE_WRITE_ERROR shadows CURLE_BAD_CONTENT_ENCODING #4310

@PersDep

Description

@PersDep

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions