Commit 17634127 authored by Greg Stein's avatar Greg Stein
Browse files

*) Add apr_bucket_setaside_noop to use for buckets that do not require a

   setaside function. It simply returns APR_SUCCESS.
   - adjust the EOS, FLUSH, IMMORTAL, and HEAP buckets to use _noop.

*) Make the setaside() function take a pool to define the (new) lifetime for
   the bucket's data.
   - Adjust the apr_bucket_setaside() macro.
   - Adjust the apr_bucket_setaside_notimpl() and transient_setaside()
     functions.
   - Pass the additional parameter in ap_save_brigade()

*) Update docs for setaside()

*) Minor nit with macros in apr_buckets.h: add parens for binding safety.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89289 13f79535-47bb-0310-9956-ffa450edef68
parent af60b7d2
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -248,6 +248,8 @@ AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, apr_bucket_brigade **sa
                                         apr_bucket_brigade **b)
{
    apr_bucket *e;
    /* ### this pool should be passed in; the caller is the only one who
       ### really knows what the proper lifetime is for this pool. */
    apr_pool_t *p = f->r ? f->r->pool : f->c->pool;
    apr_status_t rv;

@@ -259,8 +261,11 @@ AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, apr_bucket_brigade **sa
    }
    
    APR_RING_FOREACH(e, &(*b)->list, apr_bucket, link) {
        rv = apr_bucket_setaside(e);
        if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
        rv = apr_bucket_setaside(e, p);
        if (rv != APR_SUCCESS
            /* ### this ENOTIMPL will go away once we implement setaside
               ### for all bucket types. */
            && rv != APR_ENOTIMPL) {
            return rv;
        }
    }