summaryrefslogtreecommitdiff
path: root/lib/http_proxy.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/http_proxy.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/http_proxy.c')
-rw-r--r--lib/http_proxy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index 710101774..f095455a5 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -384,11 +384,12 @@ static CURLcode CONNECT(struct connectdata *conn,
/* chunked-encoded body, so we need to do the chunked dance
properly to know when the end of the body is reached */
CHUNKcode r;
+ CURLcode extra;
ssize_t tookcareof = 0;
/* now parse the chunked piece of data so that we can
properly tell when the stream ends */
- r = Curl_httpchunk_read(conn, s->ptr, 1, &tookcareof);
+ r = Curl_httpchunk_read(conn, s->ptr, 1, &tookcareof, &extra);
if(r == CHUNKE_STOP) {
/* we're done reading chunks! */
infof(data, "chunk reading DONE\n");
@@ -455,6 +456,7 @@ static CURLcode CONNECT(struct connectdata *conn,
}
else if(s->chunked_encoding) {
CHUNKcode r;
+ CURLcode extra;
infof(data, "Ignore chunked response-body\n");
@@ -472,7 +474,8 @@ static CURLcode CONNECT(struct connectdata *conn,
/* now parse the chunked piece of data so that we can
properly tell when the stream ends */
- r = Curl_httpchunk_read(conn, s->line_start + 1, 1, &gotbytes);
+ r = Curl_httpchunk_read(conn, s->line_start + 1, 1, &gotbytes,
+ &extra);
if(r == CHUNKE_STOP) {
/* we're done reading chunks! */
infof(data, "chunk reading DONE\n");