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.32 2000/12/01 08:09:57 hubbe Exp $"); + RCSID("$Id: zlibmod.c,v 1.33 2000/12/13 23:22:01 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:92:    else    Pike_error("Failed to initialize gz_deflate\n");    }   }      static int do_deflate(dynamic_buffer *buf,    struct zipper *this,    int flush)   {    int ret=0; +  int loop=0;       THREADS_ALLOW();    mt_lock(& this->lock);    THREADS_DISALLOW();    if(!this->gz.state)    ret=Z_STREAM_ERROR;    else    do    {    this->gz.next_out=low_make_buf_space(    /* recommended by the zlib people */    (this->gz.avail_out = -  this->gz.avail_in+this->gz.avail_in/1000+42), +  this->gz.avail_in ? +  this->gz.avail_in+this->gz.avail_in/1000+42 : +  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. */    } -  while (ret==Z_OK && flush==Z_FINISH); +  while (ret==Z_OK && (this->gz.avail_in || !this->gz.avail_out));       mt_unlock(& this->lock);    return ret;   }      static void gz_deflate(INT32 args)   {    struct pike_string *data;    int flush, fail;    struct zipper *this=THIS;