Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 14422 invoked from network); 9 Feb 2008 15:05:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2008 15:05:23 -0000 Received: (qmail 40914 invoked by uid 500); 9 Feb 2008 15:05:16 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 40868 invoked by uid 500); 9 Feb 2008 15:05:15 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 40857 invoked by uid 99); 9 Feb 2008 15:05:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2008 07:05:15 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2008 15:04:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7190B1A9832; Sat, 9 Feb 2008 07:04:58 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r620133 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_dir.c modules/mappers/mod_negotiation.c Date: Sat, 09 Feb 2008 15:04:58 -0000 To: cvs@httpd.apache.org From: dirkx@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080209150458.7190B1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dirkx Date: Sat Feb 9 07:04:57 2008 New Revision: 620133 URL: http://svn.apache.org/viewvc?rev=620133&view=rev Log: Sub-requests are created and used with two purposes; sometimes simply to 'see' what a request would do; as to fill out an SSI, validate access or similar - and is then discarded. And sometimes as the precursor to becoming the actual request; e.g. when mod_dir checks if an /index.html can be served for a '/'. In the latter case it is important to preserve the output filters 'for real'; whereas in the first case they have to be reset to purely the minimal proto filters (if at all). This patch instates the output filters in 3 cases where sub-requests are/may in fact be used as the real request later on. This is a relatively risky change (which should not be back-ported without further discussion) and may break caches in combination with internal redirects/vary/negotiation in subtle ways. See the thread starting at [1] and in particular the general concerns of rpluem at [2] with respect to sub requests and (fast_)internal redirects possibly needing a more thorough overhaul. 1: http://mail-archives.apache.org/mod_mbox/httpd-dev/200802.mbox/ajax/%3c335D1A4B-25E2-4FF1-8CDF-5010A7FBD293@webweaving.org%3e 2: http://mail-archives.apache.org/mod_mbox/httpd-dev/200802.mbox/%3c47ACE1D4.4060702@apache.org%3e Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/modules/mappers/mod_dir.c httpd/httpd/trunk/modules/mappers/mod_negotiation.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=620133&r1=620132&r2=620133&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Sat Feb 9 07:04:57 2008 @@ -2,6 +2,12 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_dir, mod_negotiation: pass the output filter information + to newly created sub requests; as these are later on used + as true requests with an internal redirect. This allows for + mod_cache et.al. to trap the results of the redirect. + [Dirk-Willem van Gulik, Ruediger Pluem] + *) ab: Use a 64 bit unsigned int instead of a signed long to count the bytes transferred to avoid integer overflows. PR 44346 [Ruediger Pluem] Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=620133&r1=620132&r2=620133&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mappers/mod_dir.c (original) +++ httpd/httpd/trunk/modules/mappers/mod_dir.c Sat Feb 9 07:04:57 2008 @@ -176,7 +176,7 @@ name_ptr = apr_pstrcat(r->pool, name_ptr, "?", r->args, NULL); } - rr = ap_sub_req_lookup_uri(name_ptr, r, NULL); + rr = ap_sub_req_lookup_uri(name_ptr, r, r->output_filters); /* The sub request lookup is very liberal, and the core map_to_storage * handler will almost always result in HTTP_OK as /foo/index.html Modified: httpd/httpd/trunk/modules/mappers/mod_negotiation.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_negotiation.c?rev=620133&r1=620132&r2=620133&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mappers/mod_negotiation.c (original) +++ httpd/httpd/trunk/modules/mappers/mod_negotiation.c Sat Feb 9 07:04:57 2008 @@ -1165,8 +1165,10 @@ /* Double check, we still don't multi-resolve non-ordinary files */ - if (sub_req->finfo.filetype != APR_REG) + if (sub_req->finfo.filetype != APR_REG) { + /* XXX sub req not destroyed -- may be a bug/unintentional ? */ continue; + } /* If it has a handler, we'll pretend it's a CGI script, * since that's a good indication of the sort of thing it @@ -2712,7 +2714,7 @@ if (!variant->sub_req) { int status; - sub_req = ap_sub_req_lookup_file(variant->file_name, r, NULL); + sub_req = ap_sub_req_lookup_file(variant->file_name, r, r->output_filters); status = sub_req->status; if (status != HTTP_OK && @@ -3122,7 +3124,7 @@ * a sub_req structure yet. Get one now. */ - sub_req = ap_sub_req_lookup_file(best->file_name, r, NULL); + sub_req = ap_sub_req_lookup_file(best->file_name, r, r->output_filters); if (sub_req->status != HTTP_OK) { res = sub_req->status; ap_destroy_sub_req(sub_req);