Commit 48e37b05 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

ap_save_brigade() can fail, so report what happened via an apr_status_t

return code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87548 13f79535-47bb-0310-9956-ffa450edef68
parent 2751fe65
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -399,9 +399,9 @@ AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f);
 *             new bucket brigade is returned in this location.
 * @param b The bucket brigade to save aside.  This brigade is always empty
 *          on return
 * @deffunc void ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **save_to, ap_bucket_brigade **b)
 * @deffunc apr_status_t ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **save_to, ap_bucket_brigade **b)
 */
AP_DECLARE(void) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **save_to,
AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **save_to,
                                         ap_bucket_brigade **b);    

#ifdef __cplusplus
+8 −3
Original line number Diff line number Diff line
@@ -242,11 +242,12 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next, ap_bucket_brigade *b
    return AP_NOBODY_WROTE;
}

AP_DECLARE(void) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **saveto,
AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **saveto,
                                         ap_bucket_brigade **b)
{
    ap_bucket *e;
    apr_pool_t *p = f->r ? f->r->pool : f->c->pool;
    apr_status_t rv;

    /* If have never stored any data in the filter, then we had better
     * create an empty bucket brigade so that we can concat.
@@ -256,7 +257,11 @@ AP_DECLARE(void) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **saveto,
    }
    
    AP_RING_FOREACH(e, &(*b)->list, ap_bucket, link) {
        ap_bucket_setaside(e);
        rv = ap_bucket_setaside(e);
        if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
            return rv;
        }
    }
    AP_BRIGADE_CONCAT(*saveto, *b);
    return APR_SUCCESS;
}