From 4419b1ab3235a2232d4897ccac461676a18fb33b Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 12 Jun 2001 19:03:08 +0000 Subject: [PATCH] Fix seg faults and/or missing output from mod_include. The default_handler was using the subrequest pool for files and MMAPs, even though the associated APR structures typically live longer than the subrequest. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89354 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ server/core.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8a94136e63..1920d23e78 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with Apache 2.0.19-dev + *) Fix seg faults and/or missing output from mod_include. The + default_handler was using the subrequest pool for files and + MMAPs, even though the associated APR structures typically + live longer than the subrequest. [Greg Ames] + *) Extend mod_setenvif to support specifying regular expressions on the SetEnvIf (and SetEnvIfNoCase) directive attribute field. Example: SetEnvIf ^TS* [a-z].* HAVE_TS diff --git a/server/core.c b/server/core.c index 51d84a91e4..ec32496feb 100644 --- a/server/core.c +++ b/server/core.c @@ -2920,6 +2920,7 @@ static int default_handler(request_rec *r) * when the charset is translated). */ int bld_content_md5; + apr_pool_t *main_pool; /* * The old way of doing handlers meant that this handler would @@ -2964,8 +2965,9 @@ static int default_handler(request_rec *r) if (r->method_number != M_GET && r->method_number != M_POST) { return HTTP_METHOD_NOT_ALLOWED; } + main_pool = (r->main) ? (r->main->pool) : (r->pool); - if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0, r->pool)) != APR_SUCCESS) { + if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0, main_pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, "file permissions deny server access: %s", r->filename); return HTTP_FORBIDDEN; -- 2.40.0