backport from trunk, correct solution is to expand the buffer, but that can lead...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 24 Aug 2007 19:35:40 +0000 (19:35 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 24 Aug 2007 19:35:40 +0000 (19:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@569489 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/SecureNioChannel.java

index 2463f60..b53ceef 100644 (file)
@@ -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