From: Ruediger Pluem Date: Wed, 14 Apr 2010 08:57:18 +0000 (+0000) Subject: * According to RFC2616 13.2.3 1. negative results of age calculations should X-Git-Tag: 2.3.6~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b82a2f2829e3a891562f7e01c803eadca442c588;p=apache * According to RFC2616 13.2.3 1. negative results of age calculations should be replaced by zero. Reported by: Ryujiro Shibuya git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933886 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index 73506f6834..fb4f013828 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -198,6 +198,10 @@ CACHE_DECLARE(apr_int64_t) ap_cache_current_age(cache_info *info, resident_time = now - info->response_time; current_age = corrected_initial_age + resident_time; + if (current_age < 0) { + current_age = 0; + } + return apr_time_sec(current_age); }