1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Nic fixed so that Curl_client_write() must not be called with 0 lenth data.

I edited somewhat and removed trailing whitespaces.
This commit is contained in:
Daniel Stenberg 2003-04-11 16:31:18 +00:00
parent 7b51b2f128
commit fece361a55

View File

@ -100,10 +100,11 @@ Curl_unencode_deflate_write(struct SessionHandle *data,
status = inflate(z, Z_SYNC_FLUSH);
if (status == Z_OK || status == Z_STREAM_END) {
if (DSIZ - z->avail_out) {
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
DSIZ - z->avail_out);
/* if !CURLE_OK, clean up, return */
if (result) {
if (result)
return exit_zlib(z, &k->zlib_init, result);
}
@ -130,8 +131,7 @@ static enum {
GZIP_OK,
GZIP_BAD,
GZIP_UNDERFLOW
}
check_gzip_header(unsigned char const *data, ssize_t len, ssize_t *headerlen)
} check_gzip_header(unsigned char const *data, ssize_t len, ssize_t *headerlen)
{
int method, flags;
const ssize_t totallen = len;
@ -320,10 +320,11 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
status = inflate(z, Z_SYNC_FLUSH);
if (status == Z_OK || status == Z_STREAM_END) {
if(DSIZ - z->avail_out) {
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
DSIZ - z->avail_out);
/* if !CURLE_OK, clean up, return */
if (result) {
if (result)
return exit_zlib(z, &k->zlib_init, result);
}