]> granicus.if.org Git - apache/commitdiff
Fix seg faults and/or missing output from mod_include. The
authorGreg Ames <gregames@apache.org>
Tue, 12 Jun 2001 19:03:08 +0000 (19:03 +0000)
committerGreg Ames <gregames@apache.org>
Tue, 12 Jun 2001 19:03:08 +0000 (19:03 +0000)
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
server/core.c

diff --git a/CHANGES b/CHANGES
index 8a94136e63812faf8dfdf84ab7bf596e34cbd2ef..1920d23e78ff22617a5c0cd3e2029998653634f2 100644 (file)
--- 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 
index 51d84a91e4c14c0cd53a1b9b3cb942b90499047b..ec32496feb9636a3c35339d9d2531ff13d589b36 100644 (file)
@@ -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;