Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 25347 invoked from network); 17 Jan 2007 22:23:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jan 2007 22:23:45 -0000 Received: (qmail 57981 invoked by uid 500); 17 Jan 2007 22:23:47 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 57853 invoked by uid 500); 17 Jan 2007 22:23:46 -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 57765 invoked by uid 99); 17 Jan 2007 22:23:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jan 2007 14:23:46 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.200.229.70] (HELO scorpio.lunarpages.com) (209.200.229.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jan 2007 14:23:36 -0800 Received: from wsip-70-183-62-251.oc.oc.cox.net ([70.183.62.251] helo=[10.2.8.55]) by scorpio.lunarpages.com with esmtpa (Exim 4.52) id 1H7JBa-0003o5-TF; Wed, 17 Jan 2007 14:23:14 -0800 In-Reply-To: <45AE85B6.20702@apache.org> References: <45AB7A0E.5050409@hippo.nl> <45AE85B6.20702@apache.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <41B45A9D-183F-40DC-9342-4CA9E302D4BE@gbiv.com> Cc: dev@httpd.apache.org, dev@apr.apache.org Content-Transfer-Encoding: 7bit From: "Roy T. Fielding" Subject: Re: Mod_cache expires check Date: Wed, 17 Jan 2007 14:23:12 -0800 To: Ruediger Pluem X-Mailer: Apple Mail (2.752.2) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scorpio.lunarpages.com X-AntiAbuse: Original Domain - httpd.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - gbiv.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org On Jan 17, 2007, at 12:23 PM, Ruediger Pluem wrote: > On 01/15/2007 01:56 PM, Bart van der Schans wrote: >> In r463496 the following check was added to mod_cache.c : >> >> else if (exp != APR_DATE_BAD && exp < r->request_time) >> { >> /* if a Expires header is in the past, don't cache it */ >> reason = "Expires header already expired, not cacheable"; >> } >> >> This check fails to correctly identify the expires header "Thu, 01 >> Jan >> 1970 00:00:00 GMT". The apr_date_parse_http function(exps) returns >> (apr_time_t)0 which is equal to APR_DATE_BAD, but it should >> recognize it >> as an already expired header. Is there a way to distinct between >> APR_DATE_BAD and the unix epoch? Or is that considered a bad date? > > I would say 0 is not a bad day. But if this is a bug it is an APR(- > util) bug. > Thus I forward it to the apr dev list. No, it is a bug in the expression. A date is an unsigned value and any error is specifically forced to 0 so that the comparison if (exp < r->request_time) will be true if exp == APR_DATE_BAD (as is desired in this case). ....Roy