lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


ZLib itself does support decompressing by chunks. You can read any number of bytes from the decompression stream.

On 29.01.2010 4:01, Phoenix Sol wrote:
On Thu, Jan 28, 2010 at 3:23 PM, Sam Roberts <vieuxtech@gmail.com <mailto:vieuxtech@gmail.com>> wrote:

    2010/1/28 Ignacio Burgueño <ignaciob@inconcertcc.com
    <mailto:ignaciob@inconcertcc.com>>:
    > Here is an example using deflate. It does the compression using
    streams, but
    > one needs to have the entire resulting data in memory because
    you need to
    > send the actual (compressed) content-length before sending the
    data. (this,
    > of course, if you're dealing with http)

    Can't you use chunked mode content-transfer-mode with compression?

    Sam


Yeah, you can use chunked transfer with compression, and I thought I could decompress, process, and recompress chunks of a message body in a stream. False assumption. The entire message body is compressed before it is transfered, and individual chunks can't be decompressed.

Since I want to avoid the possibility of being caught holding a bunch of large message bodies in memory, I think I will avoid accepting compressed messages from the origin server. I will just support compression in addition to chunked transfer from proxy to client.

Thanks for helping.

--

___________________________________________
Best regards,
Sergey Rozhenko                 mailto:sergroj@mail.ru