Author: markt
Date: Sat Sep 14 15:57:26 2013
New Revision: 1523272
URL: http://svn.apache.org/r1523272
Log:
Fix bytes / kilobytes mismatch that resulted in fewer objects being
cached.
Modified:
tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
Modified: tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/Cache.java?rev=1523272&r1=1523271&r2=1523272&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/Cache.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/Cache.java Sat Sep 14
15:57:26 2013
@@ -76,7 +76,7 @@ public class Cache {
// newCacheEntry was inserted into the cache - validate it
cacheEntry = newCacheEntry;
cacheEntry.validate();
- if (newCacheEntry.getContentLength() > getMaxObjectSize()) {
+ if (newCacheEntry.getContentLength() > getMaxSizeBytes()) {
// Cache size has not been updated at this point
removeCacheEntry(path, false);
return newCacheEntry;
@@ -184,6 +184,11 @@ public class Cache {
return maxSize / 1024;
}
+ public long getMaxSizeBytes() {
+ // Internally bytes, externally kilobytes
+ return maxSize;
+ }
+
public void setMaxSize(long maxSize) {
// Internally bytes, externally kilobytes
this.maxSize = maxSize * 1024;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]