Commit 403ec62f authored by Ian Holsman's avatar Ian Holsman
Browse files

dechunking filter removed.

add HTTP_IN filter after the headers have been parsed.
so that the HTTP_IN can check them ;-)
Still not 100% if this works properly, but I don't get
the chunking numbers displayed on my browser,
so it's better than what was there.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91370 13f79535-47bb-0310-9956-ffa450edef68
parent 25714fda
Loading
Loading
Loading
Loading
+4 −20
Original line number Diff line number Diff line
@@ -699,6 +699,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                if ((buf = apr_table_get(r->headers_out, "Content-Type"))) {
                    r->content_type = apr_pstrdup(p, buf);
                }            
                ap_proxy_pre_http_request(origin,rp);
            }

            /* handle Via header in response */
@@ -793,29 +794,12 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,

            const char *buf;
            apr_off_t readbytes;

            /* if chunked - insert DECHUNK filter */
            if (ap_proxy_liststr((buf = apr_table_get(r->headers_out,
                                  "Transfer-Encoding")), "chunked")) {
                rp->read_chunked = 1;
                apr_table_unset(r->headers_out, "Transfer-Encoding");
                if ((buf = ap_proxy_removestr(r->pool, buf, "chunked"))) {
                    apr_table_set(r->headers_out, "Transfer-Encoding", buf);
                }
                ap_add_input_filter("DECHUNK", NULL, rp, origin);
                readbytes = -1;
            }
            /* if content length - set the length to read */
            else if ((buf = apr_table_get(r->headers_out, "Content-Length"))) {
                readbytes = atol(buf);
            }
            /* no chunked / no length therefore read till EOF and
             * cancel keepalive
             */
            else {
                p_conn->close += 1;
            ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                         "proxy: Transfer-Encoding Chunked!");
                apr_table_unset(r->headers_out,"Content-Length");
            }

            /* if keepalive cancelled, read to EOF */
            if (p_conn->close) {
                readbytes = -1;
+0 −2
Original line number Diff line number Diff line
@@ -377,7 +377,6 @@ PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
    rp->input_filters=NULL;
    rp->output_filters  = c->output_filters;
    rp->input_filters   = c->input_filters;
    ap_proxy_pre_http_request(c,rp);

    rp->request_config  = ap_create_request_config(c->pool);
    req_cfg = apr_pcalloc(rp->pool, sizeof(core_request_config));
@@ -981,7 +980,6 @@ PROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *c
/* set up the minimal filter set */
PROXY_DECLARE(int) ap_proxy_pre_http_connection(conn_rec *c)
{
//    ap_add_input_filter("HTTP_IN", NULL, r, c);
    ap_add_input_filter("CORE_IN", NULL, NULL, c);
    ap_add_output_filter("CORE", NULL, NULL, c);
    return OK;