]> granicus.if.org Git - apache/commitdiff
Fix a bug in mod_expires. Previous to this patch, if you
authorRyan Bloom <rbb@apache.org>
Fri, 10 Aug 2001 05:29:09 +0000 (05:29 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 10 Aug 2001 05:29:09 +0000 (05:29 +0000)
told mod_expires to add 604800 seconds to the last-modified
time, it actually added 604800 usec's to the last-modified time,
so that when looking at the response it looked like nothing
had been done.  The root of the problem was that we always compute
time in usec's, but we ask users to input sec's.  This means we
need to convert to usec's before using those values.
CS: Obtained from:

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

CHANGES
modules/metadata/mod_expires.c

diff --git a/CHANGES b/CHANGES
index 444e881622d03fa33c21d3e2fd80d483c199090a..a3ba7c9fe9aa6230e5c737efdcf0f50cc6da5cc1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,14 @@
 Changes with Apache 2.0.24-dev
 
+  *) Fix a bug in mod_expires.  Previous to this patch, if you
+     told mod_expires to add 604800 seconds to the last-modified
+     time, it actually added 604800 usec's to the last-modified time,
+     so that when looking at the response it looked like nothing
+     had been done.  The root of the problem was that we always compute
+     time in usec's, but we ask users to input sec's.  This means we
+     need to convert to usec's before using those values.
+     [Ryan Bloom]
+
   *) The worker MPM now handles shutdown and restart requests.  It
      definately isn't perfect, but we do stop the servers correctly.
      The biggest problem right now is that SIGHUP causes the server to
index 46fb1abab29226f2d9f037763fd48c7e5c492bc6..549052ad4d99166e8b868d1b66d69bd209318ffe 100644 (file)
@@ -477,14 +477,14 @@ static int add_expires(request_rec *r)
            return DECLINED;
        }
        base = r->finfo.mtime;
-        additional = atoi(&code[1]);
+        additional = atoi(&code[1]) * APR_USEC_PER_SEC;
         break;
     case 'A':
         /* there's been some discussion and it's possible that 
          * 'access time' will be stored in request structure
          */
         base = r->request_time;
-        additional = atoi(&code[1]);
+        additional = atoi(&code[1]) * APR_USEC_PER_SEC;
         break;
     default:
         /* expecting the add_* routines to be case-hardened this