[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lzlib?
- From: Kein-Hong Man <mkh@...>
- Date: Tue, 15 Mar 2005 15:18:07 +0800
Rici Lake wrote:
On 14-Mar-05, at 2:06 PM, PA wrote:
local zlib = require( "zlib" )
local aCompressedContent = zlib.compress( aContent )
[snip]
"gzip stream does not have a gzip header"
What am I doing wrong? Do I need to provide additional parameters to
zlib.compress()?
You need to format the stream by sending a gzip header prior to the
compressed content. (You will also need to provide a trailer containing
a CRC.) It's annoying, isn't it? And really badly documented. Most of
the implementations I've seen are cargo culted from other implementations.
You might find this page a useful place to start. It's not the best, but
I only googled for three minutes:
http://www.cherrypy.org/wiki/NotesOnTicket59
Just look for these, they are quite readable:
RFC 1950 ZLIB Compressed Data Format Specification version 3
RFC 1951 DEFLATE Compressed Data Format Specification ver 1.3
RFC 1952 GZIP File Format Specification version 4_3
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia