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
1 changed files with 24 additions and 23 deletions

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);
}