hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r1563377 - /httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Date Sat, 01 Feb 2014 07:50:05 GMT
Author: asankha
Date: Sat Feb  1 07:50:05 2014
New Revision: 1563377

URL: http://svn.apache.org/r1563377
Log:
merge fix for HTTPCORE-371 to the 4.3.x branch

Modified:
    httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1563377&r1=1563376&r2=1563377&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Sat Feb  1 07:50:05 2014
@@ -383,15 +383,17 @@ public class SSLIOSession implements IOS
      * @throws IOException in case of an I/O error.
      */
     public synchronized boolean isAppInputReady() throws IOException {
-        final int bytesRead = receiveEncryptedData();
-        if (bytesRead == -1) {
-            this.endOfStream = true;
-        }
-        doHandshake();
-        final HandshakeStatus status = this.sslEngine.getHandshakeStatus();
-        if (status == HandshakeStatus.NOT_HANDSHAKING || status == HandshakeStatus.FINISHED)
{
-            decryptData();
-        }
+        do {
+            final int bytesRead = receiveEncryptedData();
+            if (bytesRead == -1) {
+                this.endOfStream = true;
+            }
+            doHandshake();
+            final HandshakeStatus status = this.sslEngine.getHandshakeStatus();
+            if (status == HandshakeStatus.NOT_HANDSHAKING || status == HandshakeStatus.FINISHED)
{
+                decryptData();
+            }
+        } while (this.sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_TASK);
         // Some decrypted data is available or at the end of stream
         return (this.appEventMask & SelectionKey.OP_READ) > 0
             && (this.inPlain.position() > 0



Mime
View raw message