From e4c442a46f3226a531a26cced960f91a550458da Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 13 May 2013 14:45:49 +0000 Subject: [PATCH] mod_proxy: Ensure we don't attempt to amend a table we are iterating through, ensuring that all headers listed by Connection are removed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481891 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/proxy_util.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index fecbdf7725..c664391e19 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy: Ensure we don't attempt to amend a table we are iterating + through, ensuring that all headers listed by Connection are removed. + [Graham Leggett, Co-Advisor ] + *) core: apachectl -S prints wildcard name-based virtual hosts twice. PR54948 [Eric Covener] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index f0222fe08f..d9e9e430ce 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -3000,13 +3000,13 @@ static int clear_conn_headers(void *data, const char *key, const char *val) return 1; } -static void proxy_clear_connection(apr_pool_t *p, apr_table_t *headers) +static void proxy_clear_connection(request_rec *r, apr_table_t *headers) { header_dptr x; - x.pool = p; + x.pool = r->pool; x.table = headers; apr_table_unset(headers, "Proxy-Connection"); - apr_table_do(clear_conn_headers, &x, headers, "Connection", NULL); + apr_table_do(clear_conn_headers, &x, r->headers_in, "Connection", NULL); apr_table_unset(headers, "Connection"); } @@ -3194,7 +3194,7 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p, * apr is compiled with APR_POOL_DEBUG. */ headers_in_copy = apr_table_copy(r->pool, r->headers_in); - proxy_clear_connection(p, headers_in_copy); + proxy_clear_connection(r, headers_in_copy); /* send request headers */ headers_in_array = apr_table_elts(headers_in_copy); headers_in = (const apr_table_entry_t *) headers_in_array->elts; -- 2.40.0