From ffc099b83f4c7792f4a5f394dec557f3d501e492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 15 Jul 1999 09:58:44 -0700 Subject: [PATCH] bugfix in Gz.deflate Rev: src/modules/Gz/testsuite.in:1.9 Rev: src/modules/Gz/zlibmod.c:1.26 --- src/modules/Gz/testsuite.in | 8 +++----- src/modules/Gz/zlibmod.c | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/Gz/testsuite.in b/src/modules/Gz/testsuite.in index fe34dde822..7afad39c73 100644 --- a/src/modules/Gz/testsuite.in +++ b/src/modules/Gz/testsuite.in @@ -1,4 +1,4 @@ -// $Id: testsuite.in,v 1.8 1999/06/24 23:55:01 hubbe Exp $ +// $Id: testsuite.in,v 1.9 1999/07/15 16:58:43 hubbe Exp $ cond([[ master()->resolv("Gz")->deflate ]], [[ @@ -25,8 +25,6 @@ cond([[ master()->resolv("Gz")->deflate && master()->resolv("Crypto") && master [[ dotest(Crypto.randomness.pike_random()->read(32768)) -dnl These two causes 'out of memory' errors /Hubbe -dnl -dnl dotest(Crypto.randomness.pike_random()->read(524288)) -dnl dotest(Crypto.randomness.pike_random()->read(8388608)) + dotest(Crypto.randomness.pike_random()->read(524288)) + dotest(Crypto.randomness.pike_random()->read(8388608)) ]]) diff --git a/src/modules/Gz/zlibmod.c b/src/modules/Gz/zlibmod.c index 40d0aeece3..aaba08b40b 100644 --- a/src/modules/Gz/zlibmod.c +++ b/src/modules/Gz/zlibmod.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: zlibmod.c,v 1.25 1999/06/10 20:44:12 hubbe Exp $"); +RCSID("$Id: zlibmod.c,v 1.26 1999/07/15 16:58:44 hubbe Exp $"); #include "zlib_machine.h" @@ -114,6 +114,9 @@ static int do_deflate(dynamic_buffer *buf, ret=deflate(& this->gz, flush); THREADS_DISALLOW(); + /* Absorb any unused space /Hubbe */ + low_make_buf_space(-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); -- GitLab