apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <rbl...@gmail.com>
Subject Re: Returning partial data in apr_bucket_read
Date Wed, 07 Sep 2005 23:46:26 GMT
Why don't you want to create a new bucket?  The reason for this model
is that very often the httpd code looks like:

APR_BRIGADE_FOREACH() {
    apr_bucket_read()
}

So, with this model, you need each bucket to read the whole data or
add a new bucket with the rest of the data after the current bucket,
so that on the next iteration of the loop, you continue to the next
bucket's worth of data.

What I am basically saying is that not following this convention is
likely to break a lot of apps that use buckets and expect this
behavior.

Ryan

On 9/7/05, Nick Kew <nick@webthing.com> wrote:
> It seems that standard practice when apr_bucket_read returns less than
> the entire contents of a bucket is to make an additional bucket of the
> remaining data - or data source, in a case like socket.
> 
> For a bucket type I've created, I need read to return partial data, but
> I'd prefer not to have to keep creating new buckets.  In principle it
> would be great to return a chunk of data with an EAGAIN status,
> or to expect apps to read until EOS, but neither of those is compatible
> with existing practice.
> 
> What I'm thinking of is having the bucket maintain its own state, and then
> reinsert _itself_ (as opposed to a new bucket) until the data is finished.
> Should that work, or is it asking for trouble?
> 
> --
> Nick Kew
> 


-- 
Ryan Bloom
rbb@apache.org
rbb@rkbloom.net
rbloom@gmail.com

Mime
View raw message