Author: remy.maucherat(a)jboss.com
Date: 2011-12-20 04:46:54 -0500 (Tue, 20 Dec 2011)
New Revision: 1898
Modified:
branches/2.1.x/java/org/apache/catalina/connector/OutputBuffer.java
branches/3.0.x/java/org/apache/catalina/connector/OutputBuffer.java
Log:
Port buffering fix for character output.
Modified: branches/2.1.x/java/org/apache/catalina/connector/OutputBuffer.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/connector/OutputBuffer.java 2011-12-19
17:25:14 UTC (rev 1897)
+++ branches/2.1.x/java/org/apache/catalina/connector/OutputBuffer.java 2011-12-20
09:46:54 UTC (rev 1898)
@@ -464,6 +464,10 @@
outputCharChunk.setChars(buf, off, len);
while (outputCharChunk.getLength() > 0) {
conv.convert(outputCharChunk, bb);
+ if (bb.getLength() == 0) {
+ // Break out of the loop if more chars are needed to produce any output
+ break;
+ }
if (outputCharChunk.getLength() > 0) {
bb.flushBuffer();
}
Modified: branches/3.0.x/java/org/apache/catalina/connector/OutputBuffer.java
===================================================================
--- branches/3.0.x/java/org/apache/catalina/connector/OutputBuffer.java 2011-12-19
17:25:14 UTC (rev 1897)
+++ branches/3.0.x/java/org/apache/catalina/connector/OutputBuffer.java 2011-12-20
09:46:54 UTC (rev 1898)
@@ -464,6 +464,10 @@
outputCharChunk.setChars(buf, off, len);
while (outputCharChunk.getLength() > 0) {
conv.convert(outputCharChunk, bb);
+ if (bb.getLength() == 0) {
+ // Break out of the loop if more chars are needed to produce any output
+ break;
+ }
if (outputCharChunk.getLength() > 0) {
bb.flushBuffer();
}
Show replies by date