You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2011/06/27 13:01:46 UTC

svn commit: r1140104 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java

Author: olegk
Date: Mon Jun 27 11:01:46 2011
New Revision: 1140104

URL: http://svn.apache.org/viewvc?rev=1140104&view=rev
Log:
Avoid reading from the channel if EOS has been detected (reading from half-closed channel causes an IOException on Windows)

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java?rev=1140104&r1=1140103&r2=1140104&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java Mon Jun 27 11:01:46 2011
@@ -243,6 +243,9 @@ public class SSLIOSession implements IOS
     }
 
     private int receiveEncryptedData() throws IOException {
+        if (this.endOfStream) {
+            return -1;
+        }
         return this.session.channel().read(this.inEncrypted);
     }
 
@@ -464,7 +467,7 @@ public class SSLIOSession implements IOS
         buffer.append("][");
         buffer.append(this.sslEngine.getHandshakeStatus());
         if (this.endOfStream) {
-            buffer.append("EOF][");
+            buffer.append("][EOF][");
         }
         buffer.append("][");
         buffer.append(this.inEncrypted.position());