You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2002/03/09 07:59:28 UTC

cvs commit: httpd-2.0/modules/experimental mod_cache.c mod_cache.h

minfrin     02/03/08 22:59:28

  Modified:    .        CHANGES
               modules/experimental mod_cache.c mod_cache.h
  Log:
  Scrap CacheMaxExpireMin and CacheDefaultExpireMin. Change
  CacheMaxExpire and CacheDefaultExpire to use seconds rather than
  hours.
  Reviewed by:	Bill Stoddard
  
  Revision  Changes    Path
  1.625     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.624
  retrieving revision 1.625
  diff -u -r1.624 -r1.625
  --- CHANGES	8 Mar 2002 04:14:26 -0000	1.624
  +++ CHANGES	9 Mar 2002 06:59:27 -0000	1.625
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.34-dev
   
  +  *) Scrap CacheMaxExpireMin and CacheDefaultExpireMin. Change
  +     CacheMaxExpire and CacheDefaultExpire to use seconds rather than
  +     hours. [Graham Leggett, Bill Stoddard]
  +
     *) New Directive SSIUndefinedEcho. to change the '(none)' echoed
        for a undefined variable. [Ian Holsman]
   
  
  
  
  1.34      +4 -41     httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- mod_cache.c	7 Mar 2002 22:24:56 -0000	1.33
  +++ mod_cache.c	9 Mar 2002 06:59:28 -0000	1.34
  @@ -861,24 +861,8 @@
   {
       cache_server_conf *conf = ap_get_module_config(parms->server->module_config,
                                                      &cache_module);
  -    double val;
   
  -    if (sscanf(arg, "%lg", &val) != 1)
  -        return "CacheMaxExpire value must be a float";
  -    conf->maxex = (apr_time_t) (val * MSEC_ONE_HR);
  -    conf->maxex_set = 1;
  -    return NULL;
  -}
  -static const char
  -*set_cache_maxex_min(cmd_parms *parms, void *dummy, const char *arg)
  -{
  -    cache_server_conf *conf = ap_get_module_config(parms->server->module_config,
  -                                                   &cache_module);
  -    long val;
  -
  -    val = atol(arg);
  -
  -    conf->maxex = (apr_time_t) (val * MSEC_ONE_MIN);
  +    conf->maxex = (apr_time_t) (atol(arg) * MSEC_ONE_SEC);
       conf->maxex_set = 1;
       return NULL;
   }
  @@ -888,24 +872,8 @@
   {
       cache_server_conf *conf = ap_get_module_config(parms->server->module_config, 
                                                      &cache_module);
  -    double val;
  -
  -    if (sscanf(arg, "%lg", &val) != 1)
  -        return "CacheDefaultExpire value must be a float";
  -    conf->defex = (apr_time_t) (val * MSEC_ONE_HR);
  -    conf->defex_set = 1;
  -    return NULL;
  -}
  -static const char
  -*set_cache_defex_min(cmd_parms *parms, void *dummy, const char *arg)
  -{
  -    cache_server_conf *conf = ap_get_module_config(parms->server->module_config, 
  -                                                   &cache_module);
  -    long val;
   
  -    val = atol(arg);
  -
  -    conf->defex = (apr_time_t) (val * MSEC_ONE_MIN);
  +    conf->defex = (apr_time_t) (atol(arg) * MSEC_ONE_SEC);
       conf->defex_set = 1;
       return NULL;
   }
  @@ -968,14 +936,9 @@
       AP_INIT_TAKE1("CacheDisable", add_cache_disable, NULL, RSRC_CONF,
        "A partial URL prefix below which caching is disabled"),
       AP_INIT_TAKE1("CacheMaxExpire", set_cache_maxex, NULL, RSRC_CONF,
  -     "The maximum time in hours to cache a document"),
  -    AP_INIT_TAKE1("CacheMaxExpireMin", set_cache_maxex_min, NULL, RSRC_CONF,
  -     "The maximum time in Minutes to cache a document"),
  -
  +     "The maximum time in seconds to cache a document"),
        AP_INIT_TAKE1("CacheDefaultExpire", set_cache_defex, NULL, RSRC_CONF,
  -     "The default time in hours to cache a document"),
  -     AP_INIT_TAKE1("CacheDefaultExpireMin", set_cache_defex_min, NULL, RSRC_CONF,
  -     "The default time in Minutes to cache a document"),
  +     "The default time in seconds to cache a document"),
        AP_INIT_FLAG("CacheIgnoreNoLastMod", set_cache_ignore_no_last_mod, NULL, 
                RSRC_CONF, 
                "Ignore Responses where there is no Last Modified Header"),
  
  
  
  1.22      +5 -4      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_cache.h	7 Mar 2002 22:47:15 -0000	1.21
  +++ mod_cache.h	9 Mar 2002 06:59:28 -0000	1.22
  @@ -118,12 +118,13 @@
   /* default completion is 60% */
   #define DEFAULT_CACHE_COMPLETION (60)
   #define MAX_URL_LENGTH 1024
  -#define MSEC_ONE_DAY ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds */
  -#define MSEC_ONE_HR  ((apr_time_t)(3600*APR_USEC_PER_SEC))  /* one hour, in microseconds */
  -#define MSEC_ONE_MIN  ((apr_time_t)(60*APR_USEC_PER_SEC))   /* one minute, in microseconds */
  +#define MSEC_ONE_DAY    ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds */
  +#define MSEC_ONE_HR     ((apr_time_t)(3600*APR_USEC_PER_SEC))  /* one hour, in microseconds */
  +#define MSEC_ONE_MIN    ((apr_time_t)(60*APR_USEC_PER_SEC))    /* one minute, in microseconds */
  +#define MSEC_ONE_SEC    ((apr_time_t)(APR_USEC_PER_SEC))       /* one second, in microseconds */
   #define DEFAULT_CACHE_MAXEXPIRE MSEC_ONE_DAY
   #define DEFAULT_CACHE_EXPIRE    MSEC_ONE_HR
  -#define DEFAULT_CACHE_LMFACTOR (0.1)
  +#define DEFAULT_CACHE_LMFACTOR  (0.1)
   
   /* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and 
    * PROXY_DECLARE_DATA with appropriate export and import tags for the platform