apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: apr_bucket_simple_split
Date Sun, 26 Aug 2001 14:15:04 GMT
On Sun, 26 Aug 2001, Greg Stein wrote:

> On Sat, Aug 25, 2001 at 05:09:14PM -0400, Cliff Woolley wrote:
> >...
> >  APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *a,
> > -                                                         apr_off_t point)
> > +                                                         apr_size_t point)
> Euh... why is that an apr_size_t? I thought we just talked about that
> earlier this week? A bucket could hold a *lot* more than what can fit
> in memory. I could easily have a FILE bucket that is 6gig in size
> (say, a video file). A FILE bucket can easily be split without needing
> to read anything into memory, so the apr_off_t works quite well.

Not anymore, it can't.  If your file is 6 gigs, then you have to put the
first apr_size_t's worth in one bucket and then the next apr_size_t's
worth in the next bucket and so on.

I'm not advocating it, I'm just telling it how it is today.

> > Why check to see if a->length is -1?  That's a waste of time.  If
> > a->length is -1, the bucket type should have never registered a split
> > function in the first place.
> Untrue. Please explain why a PIPE bucket cannot be split at byte 100? Sure,
> it doesn't know its length, but it can easily read in 100 bytes, give you
> that, and leave itself as the second part of the split.

Because someone told me they can't?  I advocated long ago that you should
be able to split PIPE and SOCKET buckets and that doing so should
accomplish exactly what you just described.  See the thread "Implementing
split() on pipe buckets?" from new-httpd which I started on 11/12/00.  I
even posted a patch to implement it.  Some people on the list liked the
idea, others didn't.  The ones that didn't won.  I still think they should
be splittable, but whatever.

> > What we really want to know is if point is
> > before the beginning of the bucket or after the end of the bucket.  The
> > original test gave us that.
> >
> > What am I missing?
> First off, that the point should be an apr_off_t.

For that, you'll have to go talk to OtherBill.


   Cliff Woolley
   Charlottesville, VA

View raw message