From: fhanik Date: Fri, 24 Aug 2007 19:35:40 +0000 (+0000) Subject: backport from trunk, correct solution is to expand the buffer, but that can lead... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f056ed3e7f3c26fecd0b5f0703b1e9d28a3e1605;p=tomcat7.0 backport from trunk, correct solution is to expand the buffer, but that can lead to overly large buffers, we want the the size the developers specified for predictability git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@569489 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java b/java/org/apache/tomcat/util/net/SecureNioChannel.java index 2463f60f2..b53ceefe5 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -369,6 +369,10 @@ public class SecureNioChannel extends NioChannel { if (unwrap.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks(); //if we need more network data, then bail out for now. if ( unwrap.getStatus() == Status.BUFFER_UNDERFLOW ) break; + }else if ( unwrap.getStatus()==Status.BUFFER_OVERFLOW && read>0 ) { + //buffer overflow can happen, if we have read data, then + //empty out the dst buffer before we do another read + break; }else { //here we should trap BUFFER_OVERFLOW and call expand on the buffer //for now, throw an exception, as we initialized the buffers