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

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: zlibmod.c,v 1.81 2007/06/02 14:53:23 mbaehr Exp $ + || $Id: zlibmod.c,v 1.82 2007/07/03 07:01:32 mast Exp $   */      #include "global.h"   #include "zlib_machine.h"   #include "module.h"   #include "program.h"   #include "module_support.h"      #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ)   #undef HAVE_ZLIB_H
pike.git/src/modules/Gz/zlibmod.c:173:   /* mt_unlock(& THIS->lock); */    switch(tmp)    {    case Z_OK:    return;       case Z_VERSION_ERROR:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.deflate.\n"); +  break; +     default:    if(THIS->gz.msg) -  Pike_error("Failed to initialize gz_deflate: %s\n",THIS->gz.msg); +  Pike_error("Failed to initialize Gz.deflate: %s\n",THIS->gz.msg);    else -  Pike_error("Failed to initialize gz_deflate\n"); +  Pike_error("Failed to initialize Gz.deflate (%d).\n", tmp);    }   }         static int do_deflate(dynamic_buffer *buf,    struct zipper *this,    int flush)   {    int ret=0;   
pike.git/src/modules/Gz/zlibmod.c:262:       switch(ret)    {    case Z_OK:    break;       case Z_VERSION_ERROR:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.compress.\n"); +  break; +     default:    deflateEnd(&z.gz);    if(z.gz.msg) -  Pike_error("Failed to initialize gz: %s\n", z.gz.msg); +  Pike_error("Failed to initialize Gz.compress: %s\n", z.gz.msg);    else -  Pike_error("Failed to initialize gz\n"); +  Pike_error("Failed to initialize Gz.compress (%d).\n", ret);    }       mt_init(&z.lock);       ret = do_deflate(buf, &z, Z_FINISH);       deflateEnd(&z.gz);    mt_destroy(&z.lock);       if(ret != Z_STREAM_END)
pike.git/src/modules/Gz/zlibmod.c:508:   /* mt_unlock(& THIS->lock); */    switch(tmp)    {    case Z_OK:    return;       case Z_VERSION_ERROR:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.inflate.\n"); +  break; +     default:    if(THIS->gz.msg) -  Pike_error("Failed to initialize gz_inflate: %s\n",THIS->gz.msg); +  Pike_error("Failed to initialize Gz.inflate: %s\n",THIS->gz.msg);    else -  Pike_error("Failed to initialize gz_inflate\n"); +  Pike_error("Failed to initialize Gz.inflate (%d).\n", tmp);    }   }      static int do_inflate(dynamic_buffer *buf,    struct zipper *this,    int flush)   {    int fail=0;    THREADS_ALLOW();    mt_lock(& this->lock);
pike.git/src/modules/Gz/zlibmod.c:602:       switch(ret)    {    case Z_OK:    break;       case Z_VERSION_ERROR:    Pike_error("libz not compatible with zlib.h!!!\n");    break;    +  case Z_MEM_ERROR: +  Pike_error ("Out of memory while initializing Gz.uncompress.\n"); +  inflateEnd(&z.gz); +  break; +     default:    inflateEnd( &z.gz );    if(z.gz.msg) -  Pike_error("Failed to initialize gz: %s\n", z.gz.msg); +  Pike_error("Failed to initialize Gz.uncompress: %s\n", z.gz.msg);    else -  Pike_error("Failed to initialize gz\n"); +  Pike_error("Failed to initialize Gz.uncompress (%d).\n", ret);    }       mt_init(&z.lock);    ret = do_inflate(buf, &z, Z_SYNC_FLUSH);    mt_destroy(&z.lock);    inflateEnd( &z.gz );       if(ret==Z_OK)    Pike_error("Compressed data is truncated.\n");    if(ret!=Z_STREAM_END)