]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
don't flush more than is necessary; this change keeps us
authorJeff Trawick <trawick@apache.org>
Mon, 10 Jan 2005 16:15:34 +0000 (16:15 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 10 Jan 2005 16:15:34 +0000 (16:15 +0000)
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

modules/proxy/proxy_http.c

index 1e173d68896b13d9feecc71156c84c3b4fab5d34..b24e7661fd2c11e4889337fc11e788c06d359cb4 100644 (file)
@@ -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,10 +481,15 @@ 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);
-        if (status != APR_SUCCESS) {
-            return status;
-        }
+        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;