View | Details | Raw Unified | Return to bug 37402
Collapse All | Expand All

(-)mod_proxy_http.c.orig (-17 / +26 lines)
Lines 802-828 Link Here
802
    /* We have headers, let's figure out our request body... */
802
    /* We have headers, let's figure out our request body... */
803
    input_brigade = apr_brigade_create(p, bucket_alloc);
803
    input_brigade = apr_brigade_create(p, bucket_alloc);
804
804
805
    /* sub-requests never use keepalives, and mustn't pass request bodies.
806
     * Because the new logic looks at input_brigade, we will self-terminate
807
     * input_brigade and jump past all of the request body logic...
808
     * Reading anything with ap_get_brigade is likely to consume the
809
     * main request's body or read beyond EOS - which would be unplesant.
810
     */
811
    if (r->main) {
805
    if (r->main) {
806
        /* sub-requests never use keepalives */
812
        /* XXX: Why DON'T sub-requests use keepalives? */
807
        /* XXX: Why DON'T sub-requests use keepalives? */
813
        p_conn->close++;
808
        p_conn->close++;
814
        if (old_cl_val) {
809
815
            old_cl_val = NULL;
810
        /* Most sub-requests will be GETs (from SSIs). These do
816
            apr_table_unset(r->headers_in, "Content-Length");
811
         * not have request bodies, but may have a C-L or T-E header
817
        }
812
         * taken from the main request. These need to be removed.
818
        if (old_te_val) {
813
         * Because the new logic looks at input_brigade, we will self-terminate
819
            old_te_val = NULL;
814
         * input_brigade and jump past all of the request body logic...
820
            apr_table_unset(r->headers_in, "Transfer-Encoding");
815
         * Reading anything with ap_get_brigade is likely to consume the
816
         * main request's body or read beyond EOS - which would be unplesant.
817
         * If another module generates POST sub-requests, it should
818
         * take care to provide a request body via the input filter, and
819
         * set an appropriate C-L or T-E.
820
         */
821
        if (r->method_number != M_POST) {
822
            if (old_cl_val) {
823
                old_cl_val = NULL;
824
                apr_table_unset(r->headers_in, "Content-Length");
825
            }
826
            if (old_te_val) {
827
                old_te_val = NULL;
828
               	apr_table_unset(r->headers_in, "Transfer-Encoding");
829
            }
830
            rb_method = RB_STREAM_CL;
831
            e = apr_bucket_eos_create(input_brigade->bucket_alloc);
832
            APR_BRIGADE_INSERT_TAIL(input_brigade, e);
833
            goto skip_body;
821
        }
834
        }
822
        rb_method = RB_STREAM_CL;
823
        e = apr_bucket_eos_create(input_brigade->bucket_alloc);
824
        APR_BRIGADE_INSERT_TAIL(input_brigade, e);
825
        goto skip_body;
826
    }
835
    }
827
836
828
    /* WE only understand chunked.  Other modules might inject
837
    /* WE only understand chunked.  Other modules might inject

Return to bug 37402