Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 96636 invoked by uid 500); 12 Nov 2001 07:48:23 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 96625 invoked from network); 12 Nov 2001 07:48:23 -0000 X-Authentication-Warning: localhost.localdomain: sterling owned process doing -bs Date: Fri, 9 Nov 2001 17:27:50 -0800 (PST) From: sterling X-X-Sender: To: Subject: [PATCH] headers not sent when subrequests come from ap_die Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi - I have run across a situation where the header filters are not inserted (when using ErrorDocument). Back in the day we added the add_required_filters call to ap_die to handle the scenario where the request cycle didn't quite get to the insert_filters phase. Problem is we add those filters to the request. However, the filter chain that is called is the one from the last request (e.g. r->next) - Soooo, in the right scenario, the header filters are not added to the right filter chain, hence no headers are written back to the client. here is a fix that works for me. any comments? sterling Index: modules/http/http_request.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/http/http_request.c,v retrieving revision 1.117 diff -u -r1.117 http_request.c --- modules/http/http_request.c 2001/10/30 19:21:41 1.117 +++ modules/http/http_request.c 2001/11/10 00:13:24 @@ -123,7 +123,8 @@ int error_index = ap_index_of_response(type); char *custom_response = ap_response_code_string(r, error_index); int recursive_error = 0; - + request_rec *cur; + if (type == AP_FILTER_ERROR) { return; } @@ -223,7 +224,14 @@ custom_response); } } - add_required_filters(r); + + /* need to add the filters to the last request in the chain, + cuz thats the one that's called later on. + */ + cur = r; + while( cur->next ) + cur = cur->next; + add_required_filters(cur); ap_send_error_response(r, recursive_error); }