From: Ian Holsman Date: Mon, 8 Oct 2001 21:49:17 +0000 (+0000) Subject: dechunking filter removed. X-Git-Tag: 2.0.26~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd713bba3b3f87785d5817091533f25b159a9c29;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index b9d9ddc8370..ebd6305ce43 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -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; diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 567f1486626..9dab21388f7 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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;