]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport r230735, we need not look at the first bucket for EOS,
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 8 Aug 2005 03:01:39 +0000 (03:01 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 8 Aug 2005 03:01:39 +0000 (03:01 +0000)
  because the outer while loop protected us from that case.

  Backport the header brigade changes as it's impossible to have
  a body request waiting for a final send.  Look at seen_eos to
  flush us in the request body loop, and handle the only exception,
  (header_brigade), outside of that loop.

  This brings stream_reqbody_cl in sync with the trunk.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody-2.0.x@230736 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_http.c

index e39cbaad33ee169bcb6523dc5e2ddbcd6ff9e97f..e1dc93f19c8155d62bfb1b1d441024583fad10b3 100644 (file)
@@ -586,13 +586,6 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
         if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
             seen_eos = 1;
 
-            /* As a shortcut, if this brigade is simply an EOS bucket,
-             * don't send anything down the filter chain.
-             */
-            if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) {
-                break;
-            }
-
             /* We can't pass this EOS to the output_filters. */
             e = APR_BRIGADE_LAST(input_brigade);
             apr_bucket_delete(e);
@@ -622,7 +615,8 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
             b = input_brigade;
         }
         
-        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 0);
+        /* Once we hit EOS, we are ready to flush. */
+        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, seen_eos);
         if (status != APR_SUCCESS) {
             return status;
         }
@@ -649,15 +643,11 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
 
     if (header_brigade) {
         /* we never sent the header brigade since there was no request
-         * body; send it now
+         * body; send it now with the flush flag
          */
         b = header_brigade;
+        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1);
     }
-    else {
-        /* need to flush any pending data */
-        b = input_brigade; /* empty now; pass_brigade() will add flush */
-    }
-    status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1);
     return status;
 }