1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

content_encoding: do not write 0 length data

This commit is contained in:
Patrick Monnerat 2017-11-07 02:38:34 +01:00
parent 6e6bf60357
commit 19e66e5362

View File

@ -573,8 +573,6 @@ static CURLcode brotli_unencode_write(struct connectdata *conn,
size_t dstleft; size_t dstleft;
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
if(!nbytes)
return CURLE_OK;
if(!bp->br) if(!bp->br)
return CURLE_WRITE_ERROR; /* Stream already ended. */ 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, CURLcode Curl_unencode_write(struct connectdata *conn, contenc_writer *writer,
const char *buf, size_t nbytes) const char *buf, size_t nbytes)
{ {
if(!nbytes)
return CURLE_OK;
return writer->handler->unencode_write(conn, writer, buf, nbytes); return writer->handler->unencode_write(conn, writer, buf, nbytes);
} }