I tried to send this last night, but it got filtered because it's
written in html.
Here's a text translation:
Gzip Content-Encoding in Squid Design
Version Choice
The goal will be to get these changes into Squid3 HEAD.
Content-Encoding
New HttpHdrContCode module, that parses related HTTP headers, and
arranges
for encoding or decoding appropriately. To be called from
clientProcessRequest, cacheHit, and processReplyHeader.
New HttpContentCoder abstract type, with functions:
encodeStart(): called from HttpHdrContCode
encodeEnd(): called from comm_close handler
encodeChunk(): called from storeClientCopy handler
decodeStart(): called from HttpStateData::processReplyHeader
decodeEnd(): called from comm_close handler
decodeChunk(): called from comm_read handler
doSaveEncoded()
New per-coded-object ContentCoderState, to handle coding state. It will
include fields:
HttpContentCoder *coder
off_t codedOffset
The HttpStateData class will have a usually nulled reference to a
ContentEncoder. It will only be non-null for objects which are being
encoded
or decoded.
Other changes needed:
*Add new content_coding field to HttpReply.
*New httpHeaderGetContentEncoding(HttpReply *) function in
HttpHeader.cc.
Gzip
A new GzipContentCoder module, which will be an instance of
HttpContentCoder.
Data encoding will be handled by the gzip.org zlib library. The gzip
card
drivers are expected to include a binary-compatible zlib library.
Functions:
gzEncodeStart: call inflateInit2(), write header
gzEncodeEnd: write trailer
gzEncodeChunk: call inflate()
gzDecodeStart: call deflateInit2(), read and verify header
gzDecodeEnd: verify trailer
gzDecodeChunk: call deflate()
gzDoSaveEncoded(): true
Test Strategy
Must pass the test suite.
Must add appropriate tests, including sending gzipped content to oneself
successfully.
Will also test against Apache mod_gzip implementation, and maybe even
gunzip.
Received on Thu Feb 26 2004 - 14:18:46 MST
This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:04 MST