Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 97870 invoked by uid 500); 21 Aug 2001 20:25:43 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 97859 invoked from network); 21 Aug 2001 20:25:42 -0000 Date: Tue, 21 Aug 2001 16:25:44 -0400 From: Will Lowe To: Justin Erenkrantz Cc: new-httpd@apache.org Subject: Re: [PATCH] fix segfaults related to ap_custom_response() Message-ID: <20010821162544.A21779@apollo.udlug.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010821110132.Z1397@ebuilt.com> User-Agent: Mutt/1.3.18i X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Status: O X-Status: X-Keywords: X-UID: 952 > Please resend your patch without the compression. We like our Oops. Here you go. Will diff -ur apache_1.3.20/src/main/http_core.c apache_1.3.20-new/src/main/http_core.c --- apache_1.3.20/src/main/http_core.c Fri Mar 9 02:10:25 2001 +++ apache_1.3.20-new/src/main/http_core.c Fri Aug 17 23:27:58 2001 @@ -581,9 +581,16 @@ { core_dir_config *conf; - conf = (core_dir_config *)ap_get_module_config(r->per_dir_config, + /* prefer per-request settings */ + conf = (core_dir_config *)ap_get_module_config(r->request_config, &core_module); + /* but if there aren't any, try the dir config */ + if ( conf == NULL ) { + conf = (core_dir_config *) ap_get_module_config(r->per_dir_config, + &core_module); + } + if (conf->response_code_strings == NULL) { return NULL; } @@ -1165,8 +1172,14 @@ API_EXPORT(void) ap_custom_response(request_rec *r, int status, char *string) { core_dir_config *conf = - ap_get_module_config(r->per_dir_config, &core_module); + ap_get_module_config(r->request_config, &core_module); int idx; + + if(conf == NULL) { + /* if this doesn't exist, we'll have to make one */ + conf = (core_dir_config*) ap_pcalloc(r->pool, sizeof(core_dir_config)); + ap_set_module_config(r->request_config, &core_module, conf); + } if(conf->response_code_strings == NULL) { conf->response_code_strings =