]> granicus.if.org Git - apache/commitdiff
Scrap CacheMaxExpireMin and CacheDefaultExpireMin. Change
authorGraham Leggett <minfrin@apache.org>
Sat, 9 Mar 2002 06:59:28 +0000 (06:59 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 9 Mar 2002 06:59:28 +0000 (06:59 +0000)
CacheMaxExpire and CacheDefaultExpire to use seconds rather than
hours.
PR:
Obtained from:
Submitted by:
Reviewed by: Bill Stoddard

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

CHANGES
modules/experimental/mod_cache.c
modules/experimental/mod_cache.h

diff --git a/CHANGES b/CHANGES
index 30e848a5ff5d6e8adf5bf0ae9c78c31281582118..97a1aa6c53eeeae4e718d13c6bdf878f37366f2b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
 
index c68024b0f817edceefd9eda419763df04a1f2baf..c47f4272c975e2c08d331dbcb2e96bada21af669 100644 (file)
@@ -861,24 +861,8 @@ static const char
 {
     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 @@ static const char
 {
     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 @@ static const command_rec cache_cmds[] =
     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"),
index b129c2e33769fa7f1180428184cd0272e4632da9..37cc0e5057501aa5d262c293b24ef5bf97aee5a7 100644 (file)
 /* 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