httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r469895 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_mem_cache.xml modules/cache/mod_mem_cache.c
Date Wed, 01 Nov 2006 13:02:26 GMT
Author: rpluem
Date: Wed Nov  1 05:02:25 2006
New Revision: 469895

URL: http://svn.apache.org/viewvc?view=rev&rev=469895
Log:
* Increase the minimum and default value for MCacheMinObjectSize from 0 to 1,
  as a MCacheMinObjectSize of 0 does not make sense and leads to a
  signal Floating point exception (8) (division by zero) in
  memcache_gdsf_algorithm.

PR: 40576
Submitted by: Xuekun Hu <xuekun.hu gmail.com>
Reviewed by: rpluem

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_mem_cache.xml
    httpd/httpd/trunk/modules/cache/mod_mem_cache.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=469895&r1=469894&r2=469895
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Nov  1 05:02:25 2006
@@ -2,6 +2,11 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_mem_cache: Increase the minimum and default value for
+     MCacheMinObjectSize from 0 to 1, as a MCacheMinObjectSize of 0 does not
+     make sense and leads to a division by zero.  PR 40576.
+     [Xuekun Hu <xuekun.hu gmail.com>]
+
   *) mod_cache: Pass the output filter stack through the store_body()
      hook, giving each cache backend the ability to make a better
      decision as to how it will allocate the tasks of writing to the

Modified: httpd/httpd/trunk/docs/manual/mod/mod_mem_cache.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_mem_cache.xml?view=diff&rev=469895&r1=469894&r2=469895
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_mem_cache.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_mem_cache.xml Wed Nov  1 05:02:25 2006
@@ -102,7 +102,7 @@
 <description>The minimum size (in bytes) of a document to be allowed in the
 cache</description>
 <syntax>MCacheMinObjectSize <var>bytes</var></syntax>
-<default>MCacheMinObjectSize 0</default>
+<default>MCacheMinObjectSize 1</default>
 <contextlist><context>server config</context></contextlist>
 
 <usage>

Modified: httpd/httpd/trunk/modules/cache/mod_mem_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_mem_cache.c?view=diff&rev=469895&r1=469894&r2=469895
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_mem_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_mem_cache.c Wed Nov  1 05:02:25 2006
@@ -93,7 +93,7 @@
 static mem_cache_conf *sconf;
 
 #define DEFAULT_MAX_CACHE_SIZE 100*1024
-#define DEFAULT_MIN_CACHE_OBJECT_SIZE 0
+#define DEFAULT_MIN_CACHE_OBJECT_SIZE 1
 #define DEFAULT_MAX_CACHE_OBJECT_SIZE 10000
 #define DEFAULT_MAX_OBJECT_CNT 1009
 #define DEFAULT_MAX_STREAMING_BUFFER_SIZE 100000
@@ -888,9 +888,12 @@
     apr_size_t val;
 
     if (sscanf(arg, "%" APR_SIZE_T_FMT, &val) != 1) {
-        return "MCacheMinObjectSize value must be an integer (bytes)";
+        return "MCacheMinObjectSize value must be an positive integer (bytes)";
     }
-    sconf->min_cache_object_size = val;
+    if (val > 0)
+       sconf->min_cache_object_size = val;
+    else
+       return  "MCacheMinObjectSize value must be an positive integer (bytes)";
     return NULL;
 }
 static const char



Mime
View raw message