content_encoding: do not write 0 length data
diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index 6b31685..904dff5 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -573,8 +573,6 @@
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 @@
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);
}