Commit 0100c5a3 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Backport r230735, we need not look at the first bucket for EOS, 
  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
parent 36463494
Loading
Loading
Loading
Loading
+4 −14
Original line number Original line Diff line number Diff line
@@ -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))) {
        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) {
            seen_eos = 1;
            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. */
            /* We can't pass this EOS to the output_filters. */
            e = APR_BRIGADE_LAST(input_brigade);
            e = APR_BRIGADE_LAST(input_brigade);
            apr_bucket_delete(e);
            apr_bucket_delete(e);
@@ -622,7 +615,8 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,
            b = input_brigade;
            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) {
        if (status != APR_SUCCESS) {
            return status;
            return status;
        }
        }
@@ -649,15 +643,11 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p,


    if (header_brigade) {
    if (header_brigade) {
        /* we never sent the header brigade since there was no request
        /* 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;
        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, p_conn, origin, b, 1);
        status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1);
    }
    return status;
    return status;
}
}