hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r960031 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Date Fri, 02 Jul 2010 15:35:25 GMT
Author: olegk
Date: Fri Jul  2 15:35:24 2010
New Revision: 960031

URL: http://svn.apache.org/viewvc?rev=960031&view=rev
Log:
Non-blocking connections can trigger #responseReady / #requestReady events by mistake when
the underlying session is already closed


Modified:
    httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=960031&r1=960030&r2=960031&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Fri Jul  2 15:35:24 2010
@@ -1,5 +1,9 @@
 Changes since 4.1-BETA1 
 
+* Non-blocking connections can trigger #responseReady / #requestReady events by mistake
+  when the underlying session is already closed.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCORE-228] Fixed NPE in AsyncNHttpServiceHandler caused by entity enclosing requests
   if no matching request handler can be found.  
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java?rev=960031&r1=960030&r2=960031&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
Fri Jul  2 15:35:24 2010
@@ -215,12 +215,11 @@ public class DefaultNHttpClientConnectio
                     if (this.status == CLOSING) {
                         this.session.close();
                         this.status = CLOSED;
-                        return;
                     }
-
-                    this.session.clearEvent(EventMask.WRITE);
-
-                    handler.requestReady(this);
+                    if (this.status != CLOSED) {
+                        this.session.clearEvent(EventMask.WRITE);
+                        handler.requestReady(this);
+                    }
                 }
             }
         } catch (IOException ex) {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java?rev=960031&r1=960030&r2=960031&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Fri Jul  2 15:35:24 2010
@@ -215,12 +215,11 @@ public class DefaultNHttpServerConnectio
                     if (this.status == CLOSING) {
                         this.session.close();
                         this.status = CLOSED;
-                        return;
                     }
-
-                    this.session.clearEvent(EventMask.WRITE);
-
-                    handler.responseReady(this);
+                    if (this.status != CLOSED) {
+                        this.session.clearEvent(EventMask.WRITE);
+                        handler.responseReady(this);
+                    }
                 }
             }
         } catch (IOException ex) {



Mime
View raw message