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.37 2001/01/24 19:03:25 grubba Exp $"); + RCSID("$Id: zlibmod.c,v 1.38 2001/02/08 19:06:18 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:331:    {    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(-((ptrdiff_t)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:375:    Pike_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 = DO_NOT_WARN(data->len);       initialize_buf(&buf);       SET_ONERROR(err,toss_buffer,&buf); -  fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH); +  fail=do_inflate(&buf,this,Z_SYNC_FLUSH);    UNSET_ONERROR(err);       if(fail != Z_OK && fail != Z_STREAM_END)    {    toss_buffer(&buf);    if(THIS->gz.msg)    Pike_error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg);    else    Pike_error("Error in gz_inflate->inflate(): %d\n",fail);    }