pike.git / src / modules / Gz / zlibmod.c

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: zlibmod.c,v 1.28 2000/12/13 23:24:53 hubbe Exp $"); + RCSID("$Id: zlibmod.c,v 1.29 2001/02/08 19:07:53 hubbe Exp $");      #include "zlib_machine.h"      #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ)   #undef HAVE_ZLIB_H   #endif      #ifdef HAVE_ZLIB_H      #include "interpret.h"
pike.git/src/modules/Gz/zlibmod.c:262:    {    char *loc;    int ret;    loc=low_make_buf_space(BUF,buf);    THREADS_ALLOW();    this->gz.next_out=(Bytef *)loc;    this->gz.avail_out=BUF;    ret=inflate(& this->gz, flush);    THREADS_DISALLOW();    low_make_buf_space(-this->gz.avail_out,buf); +  +  /* BUG WORKAROUND -Hubbe */ +  if(ret == Z_BUF_ERROR) ret=Z_OK; +     if(ret != Z_OK)    {    fail=ret;    break;    }    } while(!this->gz.avail_out || flush==Z_FINISH || this->gz.avail_in);    }    mt_unlock(& this->lock);    return fail;   }
pike.git/src/modules/Gz/zlibmod.c:296:    if(sp[-args].type != T_STRING)    error("Bad argument 1 to gz_inflate->inflate()\n");       data=sp[-args].u.string;       this->gz.next_in=(Bytef *)data->str;    this->gz.avail_in=data->len;       initialize_buf(&buf);    -  fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH); +  fail=do_inflate(&buf,this,Z_SYNC_FLUSH);    pop_n_elems(args);       if(fail != Z_OK && fail != Z_STREAM_END)    {    free(buf.s.str);    if(THIS->gz.msg)    error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg);    else    error("Error in gz_inflate->inflate(): %d\n",fail);    }