diff options
author | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2021-04-27 15:48:01 -0700 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-04-29 15:02:32 +0200 |
commit | 5c932f8fe9dad94a7417702958ffa9e8db67c549 (patch) | |
tree | be8e86d19e8d19571ec04a351578131f4836a2c5 /lib/transfer.c | |
parent | f4b85d24b21058215dd67e1c804d47c7b4ee2fda (diff) | |
download | curl-5c932f8fe9dad94a7417702958ffa9e8db67c549.tar.gz |
lib: fix 0-length Curl_client_write calls
Closes #6954
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 56ad5e612..c31e22e00 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -830,7 +830,7 @@ static CURLcode readwrite_data(struct Curl_easy *data, Make sure that ALL_CONTENT_ENCODINGS contains all the encodings handled here. */ if(data->set.http_ce_skip || !k->writer_stack) { - if(!k->ignorebody) { + if(!k->ignorebody && nread) { #ifndef CURL_DISABLE_POP3 if(conn->handler->protocol & PROTO_FAMILY_POP3) result = Curl_pop3_write(data, k->str, nread); @@ -840,7 +840,7 @@ static CURLcode readwrite_data(struct Curl_easy *data, nread); } } - else if(!k->ignorebody) + else if(!k->ignorebody && nread) result = Curl_unencode_write(data, k->writer_stack, k->str, nread); } k->badheader = HEADER_NORMAL; /* taken care of now */ |