hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r755823 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
Date Thu, 19 Mar 2009 03:40:49 GMT
Author: asankha
Date: Thu Mar 19 03:40:49 2009
New Revision: 755823

URL: http://svn.apache.org/viewvc?rev=755823&view=rev
Log:
commit fix for HTTPCORE-193 from Oleg after testing

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=755823&r1=755822&r2=755823&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
Thu Mar 19 03:40:49 2009
@@ -72,6 +72,7 @@
     private int appEventMask;
     private SessionBufferStatus appBufferStatus;
     
+    private boolean endOfStream;
     private volatile int status;
     
     public SSLIOSession(
@@ -163,6 +164,9 @@
                 if (result.getStatus() == Status.CLOSED) {
                     this.status = CLOSED;
                 }
+                if (result.getStatus() == Status.BUFFER_UNDERFLOW && this.endOfStream)
{
+                    this.status = CLOSED;
+                }
                 break;
             case NEED_TASK:
                 Runnable r = this.sslEngine.getDelegatedTask();
@@ -246,6 +250,9 @@
             if (result.getStatus() == Status.CLOSED) {
                 this.status = CLOSED;
             }
+            if (result.getStatus() == Status.BUFFER_UNDERFLOW && this.endOfStream)
{
+                this.status = CLOSED;
+            }
             if (result.getStatus() == Status.OK) {
                 decrypted = true;
             }
@@ -256,7 +263,7 @@
     public synchronized boolean isAppInputReady() throws IOException {
         int bytesRead = receiveEncryptedData();
         if (bytesRead == -1) {
-            this.status = CLOSED;
+            this.endOfStream = true;
         }
         doHandshake();
         decryptData();



Mime
View raw message