Commit 766177de authored by Jeff Trawick's avatar Jeff Trawick
Browse files

don't flush more than is necessary; this change keeps us

from writing small packets to the origin server when we're
streaming the request body


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody@124807 13f79535-47bb-0310-9956-ffa450edef68
parent c8c03ea8
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p,
            b = input_brigade;
        }
        
        status = pass_brigade(bucket_alloc, r, conn, origin, b, 1);
        status = pass_brigade(bucket_alloc, r, conn, origin, b, 0);
        if (status != APR_SUCCESS) {
            return status;
        }
@@ -466,7 +466,7 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
            b = input_brigade;
        }
        
        status = pass_brigade(bucket_alloc, r, conn, origin, b, 1);
        status = pass_brigade(bucket_alloc, r, conn, origin, b, 0);
        if (status != APR_SUCCESS) {
            return status;
        }
@@ -481,11 +481,16 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
            add_cl(p, bucket_alloc, header_brigade, old_cl_val);
        }
        terminate_headers(bucket_alloc, header_brigade);
        status = pass_brigade(bucket_alloc, r, conn, origin, header_brigade, 1);
        b = header_brigade;
    }
    else {
        /* need to flush any pending data */
        b = input_brigade; /* empty now; pass_brigade() will add flush */
    }
    status = pass_brigade(bucket_alloc, r, conn, origin, b, 1);
    if (status != APR_SUCCESS) {
        return status;
    }
    }

    return APR_SUCCESS;
}