Commit 1a16222d authored by Ryan Bloom's avatar Ryan Bloom
Browse files

This should fix the remaining problems with POST. Basically, we

add a new macro, called APR_BRIGADE_NORMALIZE.  This macro searches
all the buckets, and removes any zero length bucket.  They we can
just use APR_BRIGADE_EMPTY to determine if our brigade has any data,
and we can quickly call ap_get_brigade if it doesn't.

Doug, please throw your battery of tests at this to make sure it works.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90070 13f79535-47bb-0310-9956-ffa450edef68
parent acde8540
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -677,9 +677,21 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode
           ### READBYTES bytes, and we wouldn't have to do any work.
        */

        APR_BRIGADE_NORMALIZE(ctx->b);
        if (APR_BRIGADE_EMPTY(ctx->b)) {
            if ((rv = ap_get_brigade(f->next, ctx->b, mode, readbytes)) != APR_SUCCESS) {
                return rv;
            }
        }
            
        apr_brigade_partition(ctx->b, *readbytes, &e);
        APR_BRIGADE_CONCAT(b, ctx->b);
        if (e != APR_BRIGADE_SENTINEL(ctx->b)) {
            ctx->b = apr_brigade_split(b, e);
        }
        else {
            ctx->b = NULL;
        }
        apr_brigade_length(b, 1, &total);
        *readbytes -= total;