mirror of https://github.com/moparisthebest/curl
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:
parent
7b51b2f128
commit
fece361a55
|
@ -100,11 +100,12 @@ Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||||
|
|
||||||
status = inflate(z, Z_SYNC_FLUSH);
|
status = inflate(z, Z_SYNC_FLUSH);
|
||||||
if (status == Z_OK || status == Z_STREAM_END) {
|
if (status == Z_OK || status == Z_STREAM_END) {
|
||||||
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
if (DSIZ - z->avail_out) {
|
||||||
DSIZ - z->avail_out);
|
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
||||||
/* if !CURLE_OK, clean up, return */
|
DSIZ - z->avail_out);
|
||||||
if (result) {
|
/* if !CURLE_OK, clean up, return */
|
||||||
return exit_zlib(z, &k->zlib_init, result);
|
if (result)
|
||||||
|
return exit_zlib(z, &k->zlib_init, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Done?; clean up, return */
|
/* Done?; clean up, return */
|
||||||
|
@ -130,8 +131,7 @@ static enum {
|
||||||
GZIP_OK,
|
GZIP_OK,
|
||||||
GZIP_BAD,
|
GZIP_BAD,
|
||||||
GZIP_UNDERFLOW
|
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;
|
int method, flags;
|
||||||
const ssize_t totallen = len;
|
const ssize_t totallen = len;
|
||||||
|
@ -320,11 +320,12 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||||
|
|
||||||
status = inflate(z, Z_SYNC_FLUSH);
|
status = inflate(z, Z_SYNC_FLUSH);
|
||||||
if (status == Z_OK || status == Z_STREAM_END) {
|
if (status == Z_OK || status == Z_STREAM_END) {
|
||||||
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
if(DSIZ - z->avail_out) {
|
||||||
DSIZ - z->avail_out);
|
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
||||||
/* if !CURLE_OK, clean up, return */
|
DSIZ - z->avail_out);
|
||||||
if (result) {
|
/* if !CURLE_OK, clean up, return */
|
||||||
return exit_zlib(z, &k->zlib_init, result);
|
if (result)
|
||||||
|
return exit_zlib(z, &k->zlib_init, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Done?; clean up, return */
|
/* Done?; clean up, return */
|
||||||
|
|
Loading…
Reference in New Issue