From: Ryan Bloom Date: Fri, 10 Aug 2001 05:29:09 +0000 (+0000) Subject: Fix a bug in mod_expires. Previous to this patch, if you X-Git-Tag: 2.0.24~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ce46654957763f62e3a462a6be487cc52e0989d;p=apache 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. CS: Obtained from: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90066 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 444e881622..a3ba7c9fe9 100644 --- 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 diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index 46fb1abab2..549052ad4d 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -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