httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject bucket->copy()
Date Thu, 09 Nov 2000 00:56:30 GMT
I'd like to introduce a bucket->copy() function into our bucket design.

Motivation: consider the byterange filter. It needs to select subsets of a
brigade and send them to the client. We can remove the content from the
original brigade in a copy-free manner, but this is a destructive
modification to the original brigade -- we may need it for multiple ranges.

This can also eliminate the big alloc in the filter. Rather than copy all
the data from the original brigade into a memory buffer(!), we can copy
portions of the buckets and insert those into the output brigade.

Cool part: all of the refcounted buckets can support copy with *LITTLE*
effort. These included: HEAP, POOL, and MMAP. FILE should be, but it isn't
code that way right now. The TRANSIENT and IMMORTAL are butt-simple because
they would just refer to the same data. EOS and FLUSH are cake, of course.

PIPE and SOCKET are the tougher ones since they must read first, then copy
the result. But since they read into a HEAP... they are easily copied.


Given a copy operation, we should be able to do byterange handling without
any data copies.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message