You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Greg Stein <gs...@lyra.org> on 2000/12/12 00:46:19 UTC
brigade/bucket splitting (was: Re: cvs commit: apr-util STATUS)x
On Sat, Dec 09, 2000 at 01:14:57PM -0800, rbb@covalent.net wrote:
>...
> I'll buy this. I can see this being somewhat useful. Part of me thinks
> this should be implemented as a brigade_seek function. The calling code
> would then be responsible for calling ap_bucket_split and
> ap_brigade_split, but I am not sure if I agree with that or not yet.
I've been thinking of a bucket split at a specified point. That allows you
to copy the buckets before/after the split point.
This also means we're copying *a* bucket, rather than needing to pass
start/end values into a bucket copy.
If we go back to my original email, and we have a brigade such as:
B1 -> B2 -> B3/4 -> B5 -> B6/7 -> B8
And we want to copy from [4..6], then we split at the correct point within
bucket B3/4 and B6/7. That gives us this brigade:
B1 -> B2 -> B3 -> B4 -> B5 -> B6 -> B7 -> B8
Now we can copy B4..B6.
The reason that I asked for a bucket return value was so that we could split
the brigade at point P3/4, and get a pointer to B4 back (the start of the
copy). We split at point P6/7 and get P7 back (the bucket after the last to
copy).
Cheers,
-g
--
Greg Stein, http://www.lyra.org/