summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2018-02-12 03:38:18 +0100
committerPatrick Monnerat <patrick@monnerat.net>2018-02-12 03:47:36 +0100
commit155ea88184d7e4c456b38c50cb057fcbc65103f6 (patch)
tree329798a8a3332664701750747b435dbbb024a460
parent23722c515fc416ac4b024b49cba8758c329990cf (diff)
downloadcurl-155ea88184d7e4c456b38c50cb057fcbc65103f6.tar.gz
http_chunks: don't write chunks twice with CURLOPT_HTTP_TRANSFER_DECODING on
Bug: #2303 Reported-By: Henry Roeland
-rw-r--r--lib/http_chunks.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/http_chunks.c b/lib/http_chunks.c
index 2d9999f18..8368eeca6 100644
--- a/lib/http_chunks.c
+++ b/lib/http_chunks.c
@@ -178,15 +178,15 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
piece = curlx_sotouz((ch->datasize >= length)?length:ch->datasize);
/* Write the data portion available */
- if(conn->data->set.http_ce_skip || !k->writer_stack) {
- if(!k->ignorebody)
+ 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);
- }
- else
- result = Curl_unencode_write(conn, k->writer_stack, datap, piece);
- if(result)
- return CHUNKE_WRITE_ERROR;
+ if(result)
+ return CHUNKE_WRITE_ERROR;
+ }
*wrote += piece;
ch->datasize -= piece; /* decrease amount left to expect */