You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2001/08/10 07:29:09 UTC

cvs commit: httpd-2.0/modules/metadata mod_expires.c

rbb         01/08/09 22:29:09

  Modified:    .        CHANGES
               modules/metadata mod_expires.c
  Log:
  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:
  
  Revision  Changes    Path
  1.287     +9 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.286
  retrieving revision 1.287
  diff -u -r1.286 -r1.287
  --- CHANGES	2001/08/10 05:00:27	1.286
  +++ CHANGES	2001/08/10 05:29:09	1.287
  @@ -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
  
  
  
  1.34      +2 -2      httpd-2.0/modules/metadata/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_expires.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- mod_expires.c	2001/05/28 15:50:27	1.33
  +++ mod_expires.c	2001/08/10 05:29:09	1.34
  @@ -477,14 +477,14 @@
   	    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 
  
  
  

Re: cvs commit: httpd-2.0/modules/metadata mod_expires.c

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 09 August 2001 22:29, rbb@apache.org wrote:
> rbb         01/08/09 22:29:09
>
>   Modified:    .        CHANGES
>                modules/metadata mod_expires.c
>   Log:
>   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.

BTW, this was caught with the perl-framework test-suite in httpd-test.  So, we will never hit this
problem in this module again, because we already have a test for this bug.  :-)  The test was
written by John Sachs.

Ryan
_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------

Re: cvs commit: httpd-2.0/modules/metadata mod_expires.c

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 09 August 2001 22:29, rbb@apache.org wrote:
> rbb         01/08/09 22:29:09
>
>   Modified:    .        CHANGES
>                modules/metadata mod_expires.c
>   Log:
>   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.

BTW, this was caught with the perl-framework test-suite in httpd-test.  So, we will never hit this
problem in this module again, because we already have a test for this bug.  :-)  The test was
written by John Sachs.

Ryan
_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------