httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r463506 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/cache/mod_disk_cache.c modules/cache/mod_disk_cache.h
Date Thu, 12 Oct 2006 23:17:45 GMT
Author: minfrin
Date: Thu Oct 12 16:17:43 2006
New Revision: 463506

URL: http://svn.apache.org/viewvc?view=rev&rev=463506
Log:
mod_disk_cache: Make sure that only positive integers are accepted
for the CacheMaxFileSize and CacheMinFileSize parameters in the
config file. PR39380

+1: minfrin, jim, trawick

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c
    httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.h

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?view=diff&rev=463506&r1=463505&r2=463506
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Thu Oct 12 16:17:43 2006
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.4
 
+  *) mod_disk_cache: Make sure that only positive integers are accepted
+     for the CacheMaxFileSize and CacheMinFileSize parameters in the
+     config file. PR39380 [Niklas Edmundsson <nikke acc.umu.se>]
+
   *) mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
      authority component and an empty path, the empty path is to be equivalent
      to "/". It explicitly cites the following four URIs as equivalents:

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?view=diff&rev=463506&r1=463505&r2=463506
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu Oct 12 16:17:43 2006
@@ -77,22 +77,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
-      authority component and an empty path, the empty path is to be equivalent
-      to "/". It explicitly cites the following four URIs as equivalents:
-        http://example.com
-        http://example.com/
-        http://example.com:/
-        http://example.com:80/
-      Trunk: http://svn.apache.org/viewvc?view=rev&revision=450063
-      +1: minfrin, rpluem, jim
-
-    * mod_disk_cache: Make sure that only positive integers are accepted
-      for the CacheMaxFileSize and CacheMinFileSize parameters in the
-      config file. PR39380
-      Trunk: http://svn.apache.org/viewvc?view=rev&revision=450042
-      2.2.x: http://people.apache.org/~minfrin/mod_disk_cache-lfsconfig-2.2.patch
-      +1: minfrin, jim, trawick
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c?view=diff&rev=463506&r1=463505&r2=463506
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c Thu Oct 12 16:17:43 2006
@@ -1006,7 +1006,7 @@
         if (dobj->file_size > conf->maxfs) {
             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                          "cache_disk: URL %s failed the size check "
-                         "(%" APR_OFF_T_FMT ">%" APR_SIZE_T_FMT ")",
+                         "(%" APR_OFF_T_FMT " > %" APR_OFF_T_FMT ")",
                          h->cache_obj->key, dobj->file_size, conf->maxfs);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             file_cache_errorcleanup(dobj, r);
@@ -1030,7 +1030,7 @@
         if (dobj->file_size < conf->minfs) {
             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                          "cache_disk: URL %s failed the size check "
-                         "(%" APR_OFF_T_FMT "<%" APR_SIZE_T_FMT ")",
+                         "(%" APR_OFF_T_FMT " < %" APR_OFF_T_FMT ")",
                          h->cache_obj->key, dobj->file_size, conf->minfs);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             file_cache_errorcleanup(dobj, r);
@@ -1117,15 +1117,25 @@
 {
     disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
                                                  &disk_cache_module);
-    conf->minfs = atoi(arg);
+
+    if (apr_strtoff(&conf->minfs, arg, NULL, 0) != APR_SUCCESS ||
+            conf->minfs < 0) 
+    {
+        return "CacheMinFileSize argument must be a non-negative integer representing the
min size of a file to cache in bytes.";
+    }
     return NULL;
 }
+
 static const char
 *set_cache_maxfs(cmd_parms *parms, void *in_struct_ptr, const char *arg)
 {
     disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
                                                  &disk_cache_module);
-    conf->maxfs = atoi(arg);
+    if (apr_strtoff(&conf->maxfs, arg, NULL, 0) != APR_SUCCESS ||
+            conf->maxfs < 0) 
+    {
+        return "CacheMaxFileSize argument must be a non-negative integer representing the
max size of a file to cache in bytes.";
+    }
     return NULL;
 }
 

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.h?view=diff&rev=463506&r1=463505&r2=463506
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.h (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.h Thu Oct 12 16:17:43 2006
@@ -88,8 +88,8 @@
     apr_size_t cache_root_len;
     int dirlevels;               /* Number of levels of subdirectories */
     int dirlength;               /* Length of subdirectory names */
-    apr_size_t minfs;            /* minumum file size for cached files */
-    apr_size_t maxfs;            /* maximum file size for cached files */
+    apr_off_t minfs;             /* minimum file size for cached files */
+    apr_off_t maxfs;             /* maximum file size for cached files */
 } disk_cache_conf;
 
 #endif /*MOD_DISK_CACHE_H*/



Mime
View raw message