httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: apreq-2 uploads as bucket brigades?
Date Sun, 19 Jan 2003 22:39:08 GMT
Joe Schaefer wrote:
> I'd like to drop the req->upload linked list of temp files,
> and use bucket brigades in their place.  I'd planning to 
> use a common apreq_param_t struct which extends apreq_value_t 
> like so:
> struct apreq_param_t {
>     enum { ASCII, UTF_8, UTF_16, IS0_LATIN_1 } charset;
>     char                *language;
>     apreq_table_t       *info;  /* mime headers */
>     apr_bucket_brigade  *bb;    /* represents file contents */
>     apreq_value_t        v;
> };
> The main advantage of this approach would be that we can use
> the full bucket api for managing the upload data.  The brigade
> could use heap-allocated buckets for smaller uploads, and then
> switch over to mmapped or file buckets after a certain size.
> The bucket API makes this look pretty easy.

And you can even write upload hook filters with that ;)

I agree that using a polished bb API, will make apreq's code more robust, 
and may be shorter?

> The main disadvantage of this approach would be that we'd need 
> to support the full bucket api for managing the upload.
> With actual files, seek(), dup(), link(), and buffered read()
> are natural operations.  I think we'd have to provide a 
> compatibility layer for some of these, perhaps using a 
> meta-bucket at the front of the brigade?

Why would you really want to support all of them? Just croak for 
non-implemented ones and if wanted the implementation can come later.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message