]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
the check for EOS isn't going to work if we already
authorJeff Trawick <trawick@apache.org>
Wed, 5 Jan 2005 15:25:12 +0000 (15:25 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 5 Jan 2005 15:25:12 +0000 (15:25 +0000)
deleted the eos; we ended up sending the last piece
of data from the client twice; I had (poorly) modified
the EOS section from the normal idiom to keep from having
to deal with the EOS later when reusing the input
brigade

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

modules/proxy/proxy_http.c

index e11336dae6deb984982353eca6e828d0580c3e27..c0038557cd938122742ba7eb94737207b0e84ad7 100644 (file)
@@ -335,16 +335,16 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p,
         if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
             seen_eos = 1;
 
-            /* We can't pass this EOS to the output_filters. */
-            e = APR_BRIGADE_LAST(input_brigade);
-            apr_bucket_delete(e);
-
             /* 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);
         }
 
         apr_brigade_length(input_brigade, 1, &bytes);
@@ -392,6 +392,10 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p,
         b = header_brigade;
     }
     else {
+        /* input brigade still has an EOS which we can't pass to the output_filters. */
+        e = APR_BRIGADE_LAST(input_brigade);
+        AP_DEBUG_ASSERT(APR_BUCKET_IS_EOS(e));
+        apr_bucket_delete(e);
         e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
                                        /* <trailers> */
                                        ASCII_CRLF,