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.38 2001/02/08 12:44:38 hubbe Exp $"); + RCSID("$Id: zlibmod.c,v 1.39 2001/02/15 18:06:55 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:151:    4096),    buf);       THREADS_ALLOW();    ret=deflate(& this->gz, flush);    THREADS_DISALLOW();       /* Absorb any unused space /Hubbe */    low_make_buf_space(-((ptrdiff_t)this->gz.avail_out), buf);    -  /* we don't care about Z_BUF_ERROR here; it won't happen. */ +  if(ret == Z_BUF_ERROR) ret=Z_OK;    }    while (ret==Z_OK && (this->gz.avail_in || !this->gz.avail_out));       mt_unlock(& this->lock);    return ret;   }      /*! @decl string deflate(string data, int|void flush)    *!    *! This function performs gzip style compression on a string @[data] and
pike.git/src/modules/Gz/zlibmod.c:355: Inside #if 0
   fprintf(stderr,"Result [%d]: avail_out=%7d avail_in=%7d ret=%d\n",    fnord,    this->gz.avail_out,    this->gz.avail_in,    ret);   #endif       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);
pike.git/src/modules/Gz/zlibmod.c:402:    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_NO_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);    }