On Mar 26, 2008, at 5:23 PM, Konstantin Chuguev wrote:
A small correction: I meant writev() calls instead of sendfile()
when working with small-size buckets.
The filter I'm developing provisionally splits the supplied buckets
into relatively small buckets during content parsing. It then
removes some of them and inserts some other buckets. Before passing
the resulting brigade further down the filter chain, it merges all
buckets that have their data in contiguous memory regions back
together. So I guess I'm doing my bit in preventing excessive
chunking.
I've done some research on the source files of httpd-2.2.6. The CORE
filter seems to do de-chunking in the case when 16 or more buckets
are passed to it (actually, the brigade is split if it contains
flush buckets and each split part is checked for 16 buckets) AND the
total amount of bytes in the 16 buckets does not exceed 8000. The
filter then buffers the buckets together. Very clever.
Hmm - I am not sure that this always works - i.e. try this :)
$ cat test.shtml
<!--#set var="foo" value="bar" --g!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" --> <!--#set var="foo" value="bar" -->
<!--#set var="foo" value="bar" -->
(make sure that all spaces between the > and < are gone) and have the
usual:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
<Directory ..
Options Includes
..
in your config. You then get the output below.
Dw.
(echo GET /test.shtml HTTP/1.1; echo Host: localhost: echo; echo;
sleep 10) | telnet localhost 80
Connected to localhost.
Escape character is '^]'.
HTTP/1.1 200 OK
Date: Wed, 26 Mar 2008 16:39:35 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2 PHP/5.2.5
Accept-Ranges: bytes
Transfer-Encoding: chunked
Content-Type: text/html
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2