Remy Maucherat wrote:
Filip Hanik - Dev Lists wrote:
Test Case and 5.5.x patch can be found here.
http://people.apache.org/~fhanik/tomcat/b2c/
This is what is happening
int cnt=conv.read( result, 0, BUFFER_SIZE );
is called with a "while (true)" statement,
When the IntermediateInputStream.read returns -1, the above statement
returns cnt==1.
So to avoid calling conv.read, we must check to see if we have more
bytes to read by implementing the available() method, to avoid the
inputstream ever returning -1.
It's possible, but I have a hard time understanding the issue.
you'd have to run it through a debugger to understand it
Some parts of the patch look weird, in particular, the:
those are just overwritten methods from the parent. ie, no-ops right now
+import java.nio.CharBuffer;
/** Efficient conversion of bytes to character .
*
@@ -211,6 +212,18 @@
return super.read( cbuf, off, len );
}
+ public final int read() throws IOException {
+ return super.read();
+ }
+
+ public final int read(CharBuffer cb) throws IOException {
+ return super.read(cb);
+ }
+
+ public final int read(char[] cbuf) throws IOException {
+ return super.read(cbuf);
+ }
+
Overall, it's a good candidate for the new process, I think.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]