hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r1563061 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Date Fri, 31 Jan 2014 05:22:28 GMT
Author: asankha
Date: Fri Jan 31 05:22:27 2014
New Revision: 1563061

URL: http://svn.apache.org/r1563061
Log:
fix HTTPCORE-371 - support for SSL renegotiation

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

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1563061&r1=1563060&r2=1563061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Fri Jan 31 05:22:27 2014
@@ -499,15 +499,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.hasData()



Mime
View raw message