From: fhanik Date: Tue, 1 Mar 2011 19:58:55 +0000 (+0000) Subject: Correctly determine if a buffer has data or not X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e3c39ebc555c926b168f5d543fce70a103476570;p=tomcat7.0 Correctly determine if a buffer has data or not git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1076004 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 c3a9eac7d..eea964078 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -220,10 +220,10 @@ public class SecureNioChannel extends NioChannel { */ public void rehandshake(long timeout) throws IOException { //validate the network buffers are empty - if (netInBuffer.position() > 0) throw new IOException("Network input buffer still contains data. Handshake will fail."); - if (netOutBuffer.position() > 0) throw new IOException("Network output buffer still contains data. Handshake will fail."); - if (getBufHandler().getReadBuffer().position()>0) throw new IOException("Aplication input buffer still contains data. Data would have been lost."); - if (getBufHandler().getWriteBuffer().position()>0) throw new IOException("Aplication output buffer still contains data. Data would have been lost."); + if (netInBuffer.position() > 0 && netInBuffer.position() 0 && netOutBuffer.position()0 && getBufHandler().getReadBuffer().position()0 && getBufHandler().getWriteBuffer().position()