aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2017-11-07 02:38:34 +0100
committerPatrick Monnerat <patrick@monnerat.net>2017-11-07 02:38:34 +0100
commit19e66e53629de4e320a0ceafef687a861ec22fab (patch)
tree011bd4adb08ca8fb913e1e20742450f57b074c06
parent6e6bf60357f4587a7e61d34eba40b24ef9c62ac8 (diff)
content_encoding: do not write 0 length data
-rw-r--r--lib/content_encoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index 6b3168573..904dff526 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -573,8 +573,6 @@ static CURLcode brotli_unencode_write(struct connectdata *conn,
size_t dstleft;
CURLcode result = CURLE_OK;
- if(!nbytes)
- return CURLE_OK;
if(!bp->br)
return CURLE_WRITE_ERROR; /* Stream already ended. */
@@ -826,6 +824,8 @@ static contenc_writer *new_unencoding_writer(struct connectdata *conn,
CURLcode Curl_unencode_write(struct connectdata *conn, contenc_writer *writer,
const char *buf, size_t nbytes)
{
+ if(!nbytes)
+ return CURLE_OK;
return writer->handler->unencode_write(conn, writer, buf, nbytes);
}