[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lzlib?
- From: PA <petite.abeille@...>
- Date: Tue, 15 Mar 2005 12:20:41 +0100
On Mar 15, 2005, at 04:58, Rici Lake wrote:
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.)
Yes. It turns out that the answer, like in many case, is 31.
It's annoying, isn't it? And really badly documented.
Well... as Tiago Dionizio pointed out:
"The answer you are looking for is in the zlib.h header (the main source
for documentation on the library for me :)."
Most of the implementations I've seen are cargo culted from other
To quote Tiago Dionizio once more, the cult in question goes something
"To do that in lua, use the following command:
local aCompressedContent = zlib.compress( aContent, nil, nil, 15 + 16
nil values are given for some parameters so they use the default values,
the 15+16 is the windowBits value: 15 is the default value, and also the
maximum value, and the 16 is to tell the zlib library to write a gzip
header as stated in the documentation."
Works like a charm once you know the proper incantation :)
Check LWResponse's compressContent() method for all the gory details:
You might find this page a useful place to start. It's not the best,
but I only googled for three minutes:
CherryPy? CherryPy! We like CherryPy!
LuaWeb (aka LW) is going to have a somewhat similar way to publish
objects... perhaps... one day :)
PA, Onnay Equitursay