httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Buckets and brigades
Date Sat, 22 Apr 2006 08:35:08 GMT
On Saturday 22 April 2006 05:54, Brandon Fosdick wrote:
> Can I impose upon somebody to explain buckets and brigades to me?

http://www.apachetutor.org/dev/brigades

(though writing the book brings it home just how hopelessly inadequate
that little tutorial is :-( )

> That is, 
> assuming you guys are finished arguing about copyrights. :)

That one's copyright is simple enough:-)

> Specifically, I'd like to know how they relate to request processing, but
> also how they work in general. I know that a brigade is a FIFO of buckets,

An APR_RING, or doubly  linked list.

> I'm looking at mod_dav and there's a spot in the PUT handler where it
> creates a brigade, and then gets a brigade, using the same pointer, like
> so...
>
>         apr_bucket_brigade *bb;
>         bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
>         rc = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
>                                 APR_BLOCK_READ, DAV_READ_BLOCKSIZE);

That's standard for the input chain.  ap_get_brigade just populates
the brigade that was just created.

-- 
Nick Kew

Mime
View raw message