🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87186

Re: About compression with NNTP

#87186
From: Julien ÉLIE
Date: Tue, 10 Nov 2015 20:25
37 lines
3111 bytes
Hi Michael,

>  From the 'inflateInit2()' documentation in zlib.h:
> |
> | [...] windowBits must be greater than or equal to the windowBits value
> | provided to deflateInit2() while compressing, or it must be equal to
> | 15 if deflateInit2() was not used.  If a compressed stream with a
> | larger window size is given as input, inflate() will return with the
> | error code Z_DATA_ERROR instead of trying to allocate a larger window.
>
> Looks like the "intended way" to handle this is to use the zlib
> container with the window size field in its header.
> Because we want to use the raw format, the decompressor should always
> use the maximum window size (-15), or it would not be able to handle
> data that was compressed with arbitrary window size.

So it appears that implementations MUST use (-15) for the window size 
given to inflateInit2() in order to ensure interoperability.
Or should it be said that the window size MUST be the highest available? 
  (in absolute value, because in fact we take the lowest:  -15)

The documentation says "It should be in the range 8..15 for this version 
of the library" so the number may change in future versions of zlib... 
which could break existing implementations!

And what happens if someone uses an implementation of DEFLATE other than 
zlib?  Will zlib always be able to decode their compressed stream?

-- 
Julien ÉLIE

« Les grands voyages ont ceci de merveilleux que leur enchantement
   commence avant le départ même. On ouvre les atlas, on rêve sur les
   cartes. On répète les noms magnifiques des villes inconnues… »
   (Joseph Kessel)

Technical Details
Message-ID: <n1tjrv$m5q$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWN95ofdEAABgy.A1.flnews@WStation1.micha.freeshell.org> <AABWPOnx3uEAABCC.A1.flnews@WStation3.stz-e.de> <n1l1h4$4bb$1@news.trigofacile.com> <AABWPjINJkIAAAOH.A1.flnews@WStation1.micha.freeshell.org> <n1r2o7$qoj$1@news.trigofacile.com> <AABWQiV44igAADh2.A1.flnews@WStation3.stz-e.de>

Show Full Headers
Complete Article Headers
Message-ID: <n1tjrv$m5q$1@news.trigofacile.com>
Subject: Re: About compression with NNTP
Date: Tue, 10 Nov 2015 21:25:35 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWN95ofdEAABgy.A1.flnews@WStation1.micha.freeshell.org> <AABWPOnx3uEAABCC.A1.flnews@WStation3.stz-e.de> <n1l1h4$4bb$1@news.trigofacile.com> <AABWPjINJkIAAAOH.A1.flnews@WStation1.micha.freeshell.org> <n1r2o7$qoj$1@news.trigofacile.com> <AABWQiV44igAADh2.A1.flnews@WStation3.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 10 Nov 2015 20:25:35 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="aaubervilliers-651-1-233-36.w83-200.abo.wanadoo.fr:83.200.8.36";
 logging-data="22714"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0)
 Gecko/20100101 Thunderbird/38.3.0
In-Reply-To: <AABWQiV44igAADh2.A1.flnews@WStation3.stz-e.de>
X-Received-Body-CRC: 439677021
X-Received-Bytes: 3085