From: Bill Stoddard Date: Sat, 23 Feb 2002 19:31:02 +0000 (+0000) Subject: Fix problem where expiry time was being set in the past when the cache was X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a17670cbf95957248eb4077065ba1a890b09bf79;p=apache Fix problem where expiry time was being set in the past when the cache was loaded. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93551 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index 80c39a010a..f8e3700d5b 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -696,11 +696,10 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) "cache: Expiry date is %ld", (long)exp); if (exp == APR_DATE_BAD) { if (lastmod != APR_DATE_BAD) { - double x = (double) (date - lastmod) * conf->factor; - double maxex = (double)conf->maxex; - if (x > maxex) - x = maxex; - exp = now + (int) x; + apr_time_t x = (apr_time_t) ((date - lastmod) * conf->factor); + if (x > conf->maxex) + x = conf->maxex; + exp = now + x; } else exp = now + conf->defex;