You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/09/20 10:46:11 UTC

svn commit: r1761550 - in /tomcat/trunk: java/org/apache/catalina/webresources/CachedResource.java webapps/docs/changelog.xml

Author: markt
Date: Tue Sep 20 10:46:11 2016
New Revision: 1761550

URL: http://svn.apache.org/viewvc?rev=1761550&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=60146
https://bz.apache.org/bugzilla/show_bug.cgi?id=60146
Improve performance for resource retrieval by making calls to WebResource.getInputStream() trigger caching if the resource is small enough.
Patch provided by mohitchugh.

Modified:
    tomcat/trunk/java/org/apache/catalina/webresources/CachedResource.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/webresources/CachedResource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/CachedResource.java?rev=1761550&r1=1761549&r2=1761550&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/CachedResource.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/CachedResource.java Tue Sep 20 10:46:11 2016
@@ -264,7 +264,7 @@ public class CachedResource implements W
 
     @Override
     public InputStream getInputStream() {
-        byte[] content = cachedContent;
+        byte[] content = getContent();
         if (content == null) {
             // Can't cache InputStreams
             return webResource.getInputStream();

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1761550&r1=1761549&r2=1761550&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep 20 10:46:11 2016
@@ -73,6 +73,11 @@
         localized when using <code>OneLineFormatter</code>. Patch provided by
         Tatsuya Bessho. (kfujino)
       </fix>
+      <fix>
+        <bug>60146</bug>: Improve performance for resource retrieval by making
+        calls to WebResource.getInputStream() trigger caching if the resource is
+        small enough. Patch provided by mohitchugh. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org