tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1548501 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/OutputBuffer.java java/org/apache/tomcat/util/buf/ByteChunk.java webapps/docs/changelog.xml
Date Fri, 06 Dec 2013 12:26:26 GMT
Author: markt
Date: Fri Dec  6 12:26:25 2013
New Revision: 1548501

URL: http://svn.apache.org/r1548501
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55842
Check if the output buffer can grow before flushing it when using a writer.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1548498

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=1548501&r1=1548500&r2=1548501&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java Fri Dec  6 12:26:25
2013
@@ -484,7 +484,12 @@ public class OutputBuffer extends Writer
                 break;
             }
             if (outputCharChunk.getLength() > 0) {
-                bb.flushBuffer();
+                if (bb.getBuffer().length == bb.getEnd() && bb.getLength() < bb.getLimit())
{
+                    // Need to expand output buffer
+                    bb.makeSpace(outputCharChunk.getLength());
+                } else {
+                    bb.flushBuffer();
+                }
             }
         }
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=1548501&r1=1548500&r2=1548501&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java Fri Dec  6 12:26:25
2013
@@ -481,11 +481,11 @@ public final class ByteChunk implements 
         end=start;
     }
 
-    /** Make space for len chars. If len is small, allocate
-     *        a reserve space too. Never grow bigger than limit.
+    /**
+     * Make space for len chars. If len is small, allocate a reserve space too.
+     * Never grow bigger than limit.
      */
-    private void makeSpace(int count)
-    {
+    public void makeSpace(int count) {
         byte[] tmp = null;
 
         int newSize;

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1548501&r1=1548500&r2=1548501&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Dec  6 12:26:25 2013
@@ -197,6 +197,11 @@
         <bug>55839</bug>: Extend support for digest prefixes {MD5}, {SHA} and
         {SSHA} to all Realms rather than just the JNDIRealm. (markt)
       </fix>
+      <fix>
+        <bug>55842</bug>: Ensure that if a larger than default response buffer
+        is configured that the full buffer is used when a Servlet outputs via a
+        Writer. (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


Mime
View raw message