]> granicus.if.org Git - apache/commitdiff
Fix problem where expiry time was being set in the past when the cache was
authorBill Stoddard <stoddard@apache.org>
Sat, 23 Feb 2002 19:31:02 +0000 (19:31 +0000)
committerBill Stoddard <stoddard@apache.org>
Sat, 23 Feb 2002 19:31:02 +0000 (19:31 +0000)
loaded.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93551 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_cache.c

index 80c39a010a3d6ecf1b3d3e5c1e7f4273e114c2c8..f8e3700d5b6bde292eec7c7eeb3d60486d6e81ad 100644 (file)
@@ -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;