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

(-)proxy_http.c.orig (-17 / +27 lines)
Lines 1010-1035 Link Here
1010
    /* We have headers, let's figure out our request body... */
1010
    /* We have headers, let's figure out our request body... */
1011
    input_brigade = apr_brigade_create(p, bucket_alloc);
1011
    input_brigade = apr_brigade_create(p, bucket_alloc);
1012
1012
1013
    /* sub-requests never use keepalives, and mustn't pass request bodies.
1014
     * Because the new logic looks at input_brigade, we will self-terminate
1015
     * input_brigade and jump past all of the request body logic...
1016
     * Reading anything with ap_get_brigade is likely to consume the
1017
     * main request's body or read beyond EOS - which would be unplesant.
1018
     */
1019
    if (r->main) {
1013
    if (r->main) {
1014
        /* sub-requests never use keepalives */
1015
        /* XXX: Why DON'T sub-requests use keepalives? */
1020
        p_conn->close++;
1016
        p_conn->close++;
1021
        if (old_cl_val) {
1017
1022
            old_cl_val = NULL;
1018
        /* Most sub-requests will be GETs (from SSIs). These do
1023
            apr_table_unset(r->headers_in, "Content-Length");
1019
         * not have request bodies, but may have a C-L or T-E header
1024
        }
1020
         * taken from the main request. These need to be removed.
1025
        if (old_te_val) {
1021
         * Because the new logic looks at input_brigade, we will self-terminate
1026
            old_te_val = NULL;
1022
         * input_brigade and jump past all of the request body logic...
1027
            apr_table_unset(r->headers_in, "Transfer-Encoding");
1023
         * Reading anything with ap_get_brigade is likely to consume the
1024
         * main request's body or read beyond EOS - which would be unplesant.
1025
         * If another module generates POST sub-requests, it should
1026
         * take care to provide a request body via the input filter, and
1027
         * set an appropriate C-L or T-E.
1028
         */
1029
        if (r->method_number != M_POST) {
1030
            if (old_cl_val) {
1031
                old_cl_val = NULL;
1032
                apr_table_unset(r->headers_in, "Content-Length");
1033
            }
1034
            if (old_te_val) {
1035
                old_te_val = NULL;
1036
               	apr_table_unset(r->headers_in, "Transfer-Encoding");
1037
            }
1038
            rb_method = RB_STREAM_CL;
1039
            e = apr_bucket_eos_create(input_brigade->bucket_alloc);
1040
            APR_BRIGADE_INSERT_TAIL(input_brigade, e);
1041
            goto skip_body;
1028
        }
1042
        }
1029
        rb_method = RB_STREAM_CL;
1030
        e = apr_bucket_eos_create(input_brigade->bucket_alloc);
1031
        APR_BRIGADE_INSERT_TAIL(input_brigade, e);
1032
        goto skip_body;
1033
    }
1043
    }
1034
1044
1035
    /* WE only understand chunked.  Other modules might inject
1045
    /* WE only understand chunked.  Other modules might inject

Return to bug 37402