Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 82573 invoked from network); 8 Aug 2005 00:01:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2005 00:01:35 -0000 Received: (qmail 61960 invoked by uid 500); 8 Aug 2005 00:01:28 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 61938 invoked by uid 500); 8 Aug 2005 00:01:28 -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: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 61925 invoked by uid 99); 8 Aug 2005 00:01:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2005 17:01:27 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [82.195.144.76] (HELO loughan.stdlib.net) (82.195.144.76) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2005 17:01:16 -0700 Received: from colmmacc by loughan.stdlib.net with local (Exim 4.50) id 1E1v53-0006mB-Kd for dev@httpd.apache.org; Mon, 08 Aug 2005 01:01:25 +0100 Date: Mon, 8 Aug 2005 01:01:25 +0100 From: Colm MacCarthaigh To: dev@httpd.apache.org Subject: Re: [PATCH] fix incorrect 304's responses when cache is unwritable Message-ID: <20050808000125.GB25723@stdlib.net> Reply-To: colm@stdlib.net References: <20050807164843.GA22232@stdlib.net> <42F66813.3020606@gmx.de> <20050807212924.GA24773@stdlib.net> <42F68F01.5020508@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <42F68F01.5020508@gmx.de> User-Agent: Mutt/1.5.9i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Mon, Aug 08, 2005 at 12:45:21AM +0200, r.pluem@t-online.de wrote: > Is a traversal really needed? What about going back the full path of the > header / data file to the cache root and removing each component on the > way by calling apr_dir_remove on each component until it fails? I'm not sure if apr_dir_remove guarantees failure when operated on non-empty directories. If it does then that's an easy enough way. > > Are 404's being served incorrectly in some circumstances? > > You are right that 404's do not get cached. But if a cached resource > vanishes on the backend the cache entry is not removed. Aha, now I understand what this patch is meant to do. > It is needed because: > > - In the case of an internal Apache 404 error page the content filter > chain is not run (especially not CACHE_SAVE_FILTER). This is the > reason why cache_removal_url is a protocol filter. > > - In the case of an user specified error page with ErrorDocument the > CACHE_SAVE_FILTER is run with the wrong request (the one that belongs > to the custom error page, not the one of the original request). Makes sense, O.k., now looking at it and knowing what it is supposed to do, it looks fine. The only things I've noticed are; the obviously mis-copied CACHE_SAVE coment in cache_remove_url_filter() :-) The extraneous "-e debug" comments in mod_disk_cache In mod_disk_cache, you try to delete the data file even if removing the header file was unsuccesful. Personally I wouldn't be very comfortable with this, as the header is a useful source of information to an adminstrator tracking down problems and it's only easy way to determine what the data file is. If you can't delete the header file, I'd recommend leaving the data file in-place. They make more sense if they are both in the same state. In cache_remove_url, you have code which tries to determine if the cache->handle or cache->stale_handle should be removed, but shouldn't it always be the stale_handle? You only add the remove_url filter if cache_select_url() != OK, which means cache->handle will always be NULL. But apart from those looks fine. I'll merge it with my small patch and test it properly tomorrow. -- Colm MacC�rthaigh Public Key: colm+pgp@stdlib.net