mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04: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:
parent
7b51b2f128
commit
fece361a55
@ -100,10 +100,11 @@ 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) {
|
||||||
|
if (DSIZ - z->avail_out) {
|
||||||
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
||||||
DSIZ - z->avail_out);
|
DSIZ - z->avail_out);
|
||||||
/* if !CURLE_OK, clean up, return */
|
/* if !CURLE_OK, clean up, return */
|
||||||
if (result) {
|
if (result)
|
||||||
return exit_zlib(z, &k->zlib_init, result);
|
return exit_zlib(z, &k->zlib_init, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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,10 +320,11 @@ 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) {
|
||||||
|
if(DSIZ - z->avail_out) {
|
||||||
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
||||||
DSIZ - z->avail_out);
|
DSIZ - z->avail_out);
|
||||||
/* if !CURLE_OK, clean up, return */
|
/* if !CURLE_OK, clean up, return */
|
||||||
if (result) {
|
if (result)
|
||||||
return exit_zlib(z, &k->zlib_init, result);
|
return exit_zlib(z, &k->zlib_init, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user