From 19e66e53629de4e320a0ceafef687a861ec22fab Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Tue, 7 Nov 2017 02:38:34 +0100 Subject: content_encoding: do not write 0 length data --- lib/content_encoding.c | 4 ++-- 1 file 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); } -- cgit v1.2.3