You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2013/08/18 18:30:22 UTC

svn commit: r1515162 - /httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c

Author: sf
Date: Sun Aug 18 16:30:21 2013
New Revision: 1515162

URL: http://svn.apache.org/r1515162
Log:
Limit SHMCB_MAX_SIZE to min(UINT_MAX, APR_SIZE_MAX) to match the current code

Modified:
    httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c

Modified: httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c?rev=1515162&r1=1515161&r2=1515162&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Sun Aug 18 16:30:21 2013
@@ -30,7 +30,14 @@
 
 #include "ap_socache.h"
 
-#define SHMCB_MAX_SIZE APR_SIZE_MAX
+/* XXX Unfortunately, there are still many unsigned ints in use here, so we
+ * XXX cannot allow more than UINT_MAX. Since some of the ints are exposed in
+ * XXX public interfaces, a simple search and replace is not enough.
+ * XXX It should be possible to extend that so that the total cache size can
+ * XXX be APR_SIZE_MAX and only the object size needs to be smaller than
+ * XXX UINT_MAX.
+ */
+#define SHMCB_MAX_SIZE (UINT_MAX<APR_SIZE_MAX ? UINT_MAX : APR_SIZE_MAX)
 
 #define DEFAULT_SHMCB_PREFIX "socache-shmcb-"