httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sorin Manolache" <>
Subject Re: number of bytes/packets sent/received
Date Thu, 09 Oct 2008 14:11:24 GMT
On Thu, Oct 9, 2008 at 15:54, Andrej van der Zee
<> wrote:
> Hi,
>> No, the Content-Length doesn't include the size of the headers.
> Yes of course, but you could add the length of all r->headers_in.

It's not very reliable. In headers_out you have things like "key" and
"value", while the resulting header is "key: value\r\n". Then, I am
not sure if the ap_http_header_filter that transforms the apr_table_t
*headers_out to strings changes/inserts headers. Then there are two
other filters, the byte-range and the content-length filter. The
content-length filter sets the value of the Content-Length header
while I don't know what the byte-range filter does (maybe it is
applicable in the case of chunked transport). You would need to count
the size of the headers_out _after_ such filters alter the headers.
So... too hairy.

> I just wondered if the content-type reflects the actual size, for
> example if the request is compressed.

If the request is compressed, Content-Length indicates the length of
the _compressed_ body. Content-Type should stay unmodified regardless
if the body is compressed or not. However, a compressed body is
flagged by the "Content-Encoding: gzip" header (or "deflate").


View raw message