httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental cache_util.c mod_cache.h
Date Wed, 30 Oct 2002 14:01:35 GMT
stoddard    2002/10/30 06:01:35

  Modified:    modules/experimental cache_util.c mod_cache.h
  Log:
  Use r->request_time in lieu of apr_time_now() in cache object age calculations
  
  Revision  Changes    Path
  1.21      +4 -3      httpd-2.0/modules/experimental/cache_util.c
  
  Index: cache_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_util.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- cache_util.c	12 Oct 2002 07:51:09 -0000	1.20
  +++ cache_util.c	30 Oct 2002 14:01:35 -0000	1.21
  @@ -138,7 +138,8 @@
   
   
   /* do a HTTP/1.1 age calculation */
  -CACHE_DECLARE(apr_int64_t) ap_cache_current_age(cache_info *info, const apr_time_t age_value)
  +CACHE_DECLARE(apr_int64_t) ap_cache_current_age(cache_info *info, const apr_time_t age_value,
  +                                                apr_time_t now)
   {
       apr_time_t apparent_age, corrected_received_age, response_delay, corrected_initial_age,
              resident_time, current_age;
  @@ -149,7 +150,7 @@
       corrected_received_age = MAX(apparent_age, age_value);
       response_delay = info->response_time - info->request_time;
       corrected_initial_age = corrected_received_age + response_delay;
  -    resident_time = apr_time_now() - info->response_time;
  +    resident_time = now - info->response_time;
       current_age = corrected_initial_age + resident_time;
   
       return apr_time_sec(current_age);
  @@ -206,7 +207,7 @@
       }
   
       /* calculate age of object */
  -    age = ap_cache_current_age(info, age_c);
  +    age = ap_cache_current_age(info, age_c, r->request_time);
   
       /* extract s-maxage */
       if (cc_cresp && ap_cache_liststr(r->pool, cc_cresp, "s-maxage", &val))
  
  
  
  1.35      +2 -1      httpd-2.0/modules/experimental/mod_cache.h
  
  Index: mod_cache.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- mod_cache.h	13 Oct 2002 19:35:04 -0000	1.34
  +++ mod_cache.h	30 Oct 2002 14:01:35 -0000	1.35
  @@ -257,7 +257,8 @@
   
   /* cache_util.c */
   /* do a HTTP/1.1 age calculation */
  -CACHE_DECLARE(apr_time_t) ap_cache_current_age(cache_info *info, const apr_time_t age_value);
  +CACHE_DECLARE(apr_time_t) ap_cache_current_age(cache_info *info, const apr_time_t age_value,
  +                                               apr_time_t now);
   
   /**
    * Check the freshness of the cache object per RFC2616 section 13.2 (Expiration Model)
  
  
  

Mime
View raw message