On 26/09/2006, at 05:52, Niklas Edmundsson wrote:


This patch depends on "mod_disk_cache LFS-aware config" submitted earlier and is for trunk.

It makes caching of large files possible on 32bit machines by:

* Realising that a file is a file and can be copied as such, without
  reading the whole thing into memory first.

Hi,

Wouldn't you avoid a lot of complexity in this patch
if you just deleted from the brigade the implicitly
created heap buckets while reading file buckets ?

Something like:

store_body:
        .. if (is_file_bucket(bucket))
                copy_file_bucket(bucket, bb);

copy_file_bucket:

while (bucket != sentinel(bb) && is_file_bucket(bucket) {
        rv = apr_bucket_read(..)
        if (is_heap_bucket(bucket)) {
                apr_bucket *tmp = bucket;
                bucket = bucket_next(tmp);
                bucket_delete(tmp);
        }
        else
                bucket = bucket_next(bucket);
}

IMHO, this is a lot better than all that added complexity
for a corner case.

--
Davi Arnaut

Reply via email to