Added support for when the buffers are sized very similarly
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 24 Aug 2007 19:32:34 +0000 (19:32 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 24 Aug 2007 19:32:34 +0000 (19:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@569485 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/tomcat/util/net/SecureNioChannel.java

index 3b8496e..b2e8908 100644 (file)
@@ -841,6 +841,9 @@ public class Http11NioProcessor implements ActionHook {
                     socket.getIOChannel().socket().setSoTimeout((int)timeout);
                 }
             } catch (IOException e) {
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("http11processor.header.parse"), e);
+                }
                 error = true;
                 break;
             } catch (Throwable t) {
index 3fbcc69..79f6e17 100644 (file)
@@ -370,6 +370,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