httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <>
Subject [PATCH] core_filter buffering
Date Wed, 27 Sep 2000 22:18:26 GMT
The idea behind this patch (not fully implemented) is to save contents of bucket
brigades in an array of iovecs hung off of core_filter->ctx. When the eos bucket
arrives, the iovecs in core_filter->ctx are sent to the network using
apr_sendv().  The patch also has an optimization to send the iovecs if the
number of bytes represented by the iovecs exceeds some threshold value (8192
bytes).  I can easily add other triggers to do network i/o (do not exceed x
number of iovecs, etc.).

A few observations...
First, I believe the chunked filter has a bug. The chunking headers are
allocated off the stack. ap_create_bucket_transient() just saves away the
pointers passed in to it, so the bucket is really only valid as long as the
storage it points to. To fix this, I allocated the chunking headers out of the
f->r->pool.  I can't claim to completely understand the filter philosophy, so
I'm looking on comments on the appropriateness of this solution.

Second, auto_index generates huge numbers of small chunks. Seeing a response (in
a single buffer) with 50 encoded 'chunks' is not esthetically pleasing  :-).  It
seems that we need to introduce some sort of buffering heuristics (yea, with
data copies) somewhere higher up (than core_filter) in the filter chain.
Preferably in a place where it is transparently accessable to all modules.

Third, there are still problems with this patch, related to storage lifetimes I
suspect. I've run out of time today to continue debugging..

Bill Stoddard

View raw message