mirror of
https://github.com/curl/curl.git
synced 2026-08-24 23:43:40 +03:00
chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING error
Unknown content-encoding would get returned as CURLE_WRITE_ERROR if the response is chunked-encoded. Reported-by: Ilya Kosarev Fixes #4310 Closes #4449
This commit is contained in:
parent
ac830139da
commit
f0f053fed0
5 changed files with 39 additions and 24 deletions
|
|
@ -776,14 +776,14 @@ static CURLcode readwrite_data(struct Curl_easy *data,
|
|||
* and writes away the data. The returned 'nread' holds the number
|
||||
* of actual data it wrote to the client.
|
||||
*/
|
||||
|
||||
CURLcode extra;
|
||||
CHUNKcode res =
|
||||
Curl_httpchunk_read(conn, k->str, nread, &nread);
|
||||
Curl_httpchunk_read(conn, k->str, nread, &nread, &extra);
|
||||
|
||||
if(CHUNKE_OK < res) {
|
||||
if(CHUNKE_WRITE_ERROR == res) {
|
||||
failf(data, "Failed writing data");
|
||||
return CURLE_WRITE_ERROR;
|
||||
if(CHUNKE_PASSTHRU_ERROR == res) {
|
||||
failf(data, "Failed reading the chunked-encoded stream");
|
||||
return extra;
|
||||
}
|
||||
failf(data, "%s in chunked-encoding", Curl_chunked_strerror(res));
|
||||
return CURLE_RECV_ERROR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue