apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject [PATCH] bucket type "capabilities" flags
Date Tue, 19 Jun 2001 01:20:48 GMT

The attached patch adds a capabilities flag field to the
apr_bucket_type_t.  Flags currently included indicate whether the
"optional" functions (setaside,copy,split) are implemented or not without
having to actually call them to find out, whether the bucket is a
"metadata" bucket, and whether the bucket has a file descriptor in it for
the use by apr_sendfile().

The main reason I need this right now is that I've implemented and am
about to commit a patch to Apache's mod_file_cache that uses a custom
bucket type ("ap_bucket_cachedfile") to denote a file descriptor that's
shared among multiple threads.  Such a file descriptor can be sendfile'd,
but cannot be read by other means without causing thread-safety problems.
Apache's core_output_filter currently is hardcoded to assume that a bucket
can be sendfile'd ONLY if it matches APR_BUCKET_IS_FILE(), though the
above is clearly a case where an APR_BUCKET_SUPPORTS_SENDFILE() test would
be much more useful and extensible.  The flags field gives us that

I can easily see future situations arising where similar strategies would
be useful, so adding a flags field now would allow us to easily handle
those situations.

If nobody objects, I'll commit this tomorrow, followed closely by the
patch to mod_file_cache and the core_output_filter in Apache.


PS: I tried to find names for these flags that were both descriptive and
reasonably short, but if anybody has any better ideas, I'm all ears...

   Cliff Woolley
   Charlottesville, VA

View raw message