Commit fece361a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

I edited somewhat and removed trailing whitespaces.
parent 7b51b2f1
Loading
Loading
Loading
Loading
+24 −23
Original line number Diff line number Diff line
@@ -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);
      }