From a8482b67cf13f3b38d286dee1750bb0369c93379 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Sat, 3 Jun 2006 19:41:49 +0000 Subject: [PATCH] * info->expire and info->date are in microseconds. So convert the difference to seconds before comparing it to age which is in seconds. PR: 39713 Submitted by: Owen Taylor Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@411464 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 +++++++--- modules/cache/cache_util.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index fc2b8d3466..971f7168d0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,9 +2,13 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] - *) mod_authnz_ldap: Fix a problem with invalid auth error detection for - LDAP client SDKs that don't support LDAP_SECURITY_ERROR macro. PR#39529 - [Ray Price ], [Josh Fenlason ] + *) mod_cache: Convert age of cached object to seconds before comparing it to + age supplied by the request when checking whether to send a Warning + header for a stale response. PR 39713. [Owen Taylor ] + + *) mod_authnz_ldap: Fix a problem with invalid auth error detection for + LDAP client SDKs that don't support LDAP_SECURITY_ERROR macro. PR 39529. + [Ray Price , Josh Fenlason ] *) mod_cache: Do not overwrite the Content-Type in the cache, for successfully revalidated cached objects. PR 39647. [Ruediger Pluem] diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index e1cec91ee2..3100f54f3a 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -314,7 +314,7 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, if (!(((smaxage != -1) && age < smaxage) || ((maxage != -1) && age < maxage) || (info->expire != APR_DATE_BAD && - (info->expire - info->date) > age))) { + (apr_time_sec(info->expire - info->date)) > age))) { /* make sure we don't stomp on a previous warning */ if ((warn_head == NULL) || ((warn_head != NULL) && (ap_strstr_c(warn_head, "110") == NULL))) { -- 2.40.0