On Wed, 2008-02-27 at 17:08 -0700, Filip Hanik - Dev Lists wrote: > Remy Maucherat wrote: > > This makes me think there's a straight issue in CharChunk (I suppose the > > problem is that realReadChars gets called with len = 0; if it handled > > that scenario, things should be fine). > > > the old char chunk worked just fine, so why not stick with it. the error > above is a result of B2CConverter and InputBuffer being modified
Ok, but the new code looks a bit nicer, so I would prefer keeping it if possible. From what I can see, your code replaces the limit value (the one which would cause the problem if it was 0) by the amount of bytes which have been read in the ByteChunk. This would translate to: Index: java/org/apache/catalina/connector/InputBuffer.java =================================================================== ---java/org/apache/catalina/connector/InputBuffer.java (revision 630535) +++java/org/apache/catalina/connector/InputBuffer.java (working copy) @@ -355,7 +355,7 @@ } state = CHAR_STATE; - conv.convert(bb, cb, len); + conv.convert(bb, cb, bb.getLength()); bb.setOffset(bb.getEnd()); return cb.getLength(); The problem is that I sort of like the idea of the limit (it's related to the space left in the char buffer for adding the parsed chars). So maybe trying to respect that with a decent fallback could work (didn't try it): Index: java/org/apache/catalina/connector/InputBuffer.java =================================================================== ---java/org/apache/catalina/connector/InputBuffer.java (revision 630535) +++java/org/apache/catalina/connector/InputBuffer.java (working copy) @@ -355,7 +355,7 @@ } state = CHAR_STATE; - conv.convert(bb, cb, len); + conv.convert(bb, cb, (len == 0) ? bb.getLength() : len); bb.setOffset(bb.getEnd()); return cb.getLength(); Rémy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]