summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-01 15:40:05 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-10-02 07:46:05 +0200
commitf0f053fed034bacf956a9f32ea65529b0b123247 (patch)
treebb3f25d59646cb85cd64728e4c95d3c6df436da4 /lib/transfer.c
parentac830139dadf4abd48232e3eb5ce0c8d06d19dcf (diff)
downloadcurl-f0f053fed034bacf956a9f32ea65529b0b123247.tar.gz
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
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index ef0d80638..44aa10971 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -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;