Mailing List Archive

A compress patch
For the curious one, this patch (against 0.4.5) fixes the compress
bug:


--- ../archive/gnupg-0.4.5/g10/compress.c Tue Aug 11 13:14:28 1998
+++ g10/compress.c Wed Dec 9 11:45:41 1998
@@ -76,8 +76,8 @@
zs->next_out = zfx->outbuf;
zs->avail_out = zfx->outbufsize;
if( DBG_FILTER )
- log_debug("call deflate: avail_in=%u, avail_out=%u\n",
- (unsigned)zs->avail_in, (unsigned)zs->avail_out);
+ log_debug("enter deflate: avail_in=%u, avail_out=%u, flush=%d\n",
+ (unsigned)zs->avail_in, (unsigned)zs->avail_out, flush );
zrc = deflate( zs, flush );
if( zrc == Z_STREAM_END && flush == Z_FINISH )
;
@@ -89,8 +89,10 @@
}
n = zfx->outbufsize - zs->avail_out;
if( DBG_FILTER )
- log_debug("deflate returned: avail_in=%u, avail_out=%u, n=%u\n",
- (unsigned)zs->avail_in, (unsigned)zs->avail_out, (unsigned)n );
+ log_debug("leave deflate: "
+ "avail_in=%u, avail_out=%u, n=%u, zrc=%d\n",
+ (unsigned)zs->avail_in, (unsigned)zs->avail_out,
+ (unsigned)n, zrc );

if( iobuf_write( a, zfx->outbuf, n ) ) {
log_debug("deflate: iobuf_write failed\n");
@@ -132,12 +134,14 @@
size_t n;
byte *p;
int c;
+ int refill = !zs->avail_in;

if( DBG_FILTER )
- log_debug("do_uncompress: avail_in=%u, avail_out=%u\n",
- (unsigned)zs->avail_in, (unsigned)zs->avail_out);
+ log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n",
+ (unsigned)zs->avail_in, (unsigned)zs->avail_out,
+ (unsigned)zfx->inbufsize );
do {
- if( zs->avail_in < zfx->inbufsize ) {
+ if( zs->avail_in < zfx->inbufsize && refill ) {
n = zs->avail_in;
if( !n )
zs->next_in = zfx->inbuf;
@@ -148,8 +152,9 @@
}
zs->avail_in = n;
}
+ refill = 1;
if( DBG_FILTER )
- log_debug("call inflate: avail_in=%u, avail_out=%u\n",
+ log_debug("enter inflate: avail_in=%u, avail_out=%u\n",
(unsigned)zs->avail_in, (unsigned)zs->avail_out);
#ifdef Z_SYNC_FLUSH
zrc = inflate( zs, Z_SYNC_FLUSH );
@@ -157,7 +162,7 @@
zrc = inflate( zs, Z_PARTIAL_FLUSH );
#endif
if( DBG_FILTER )
- log_debug("inflate returned: avail_in=%u, avail_out=%u, zrc=%d\n",
+ log_debug("leave inflate: avail_in=%u, avail_out=%u, zrc=%d\n",
(unsigned)zs->avail_in, (unsigned)zs->avail_out, zrc);
if( zrc == Z_STREAM_END )
rc = -1; /* eof */
Re: A compress patch [ In reply to ]
On Wed, Dec 09, 1998 at 06:50:57PM +0100, Werner Koch wrote:
> For the curious one, this patch (against 0.4.5) fixes the compress
> bug:

Hrrrm, I'm still getting:
| gpg: iobuf-5.3: clear_eof 'decode_filter' with enabled filter
| gpg: iobuf-5.3: clear_eof 'decode_filter' with no EOF pending
|
| gpg: Ohhhh jeeee: Ohh jeee, trying to remove an intermediate filter
| secmem usage: 2016/8224 bytes in 6/12 blocks of pool 8448/16384

Only with things from a couple senders, both using Eudora:
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32))
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.2

I don't know if that's relevant since I don't run Windows.

--
Brian Moore | "The Zen nature of a spammer resembles
Sysadmin, C/Perl Hacker | a cockroach, except that the cockroach
Usenet Vandal | is higher up on the evolutionary chain."
Netscum, Bane of Elves. Peter Olson, Delphi Postmaster