hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1209164 - in /httpcomponents/httpcore/branches/4.1.x: ./ httpcore-nio/src/main/java/org/apache/http/impl/nio/
Date Thu, 01 Dec 2011 17:31:11 GMT
Author: olegk
Date: Thu Dec  1 17:31:09 2011
New Revision: 1209164

URL: http://svn.apache.org/viewvc?rev=1209164&view=rev
Log:
HTTPCORE-283: Workaround for a bug causing termination of the I/O reactor in case of exception
thrown by NHttpServiceHandler#requestReceived or NHttpClientHandler#responseReceived methods.
A more comprehensive fix for the bug applied to the (4.2 branch)

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

Modified: httpcomponents/httpcore/branches/4.1.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.1.x/RELEASE_NOTES.txt?rev=1209164&r1=1209163&r2=1209164&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.1.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/branches/4.1.x/RELEASE_NOTES.txt Thu Dec  1 17:31:09 2011
@@ -1,6 +1,11 @@
 Changes since 4.1.3
 -------------------
 
+* [HTTPCORE-283] Workaround for a bug causing termination of the I/O reactor in case of exception

+  thrown by NHttpServiceHandler#requestReceived or NHttpClientHandler#responseReceived
+  methods. A more comprehensive fix for the bug applied to the (4.2 branch).
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCORE-281] ResponseConnControl protocol interceptor does not correctly populate connection
   persistence control headers when sending a HTTP/1.1 response message in response to a HTTP/1.0

   request message.

Modified: httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java?rev=1209164&r1=1209163&r2=1209164&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
(original)
+++ httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
Thu Dec  1 17:31:09 2011
@@ -162,6 +162,9 @@ public class DefaultNHttpClientConnectio
                         this.connMetrics.incrementResponseCount();
                     }
                     handler.responseReceived(this);
+                    if (this.session.isClosed()) {
+                        return;
+                    }
                     if (this.contentDecoder == null) {
                         resetInput();
                     }
@@ -172,6 +175,9 @@ public class DefaultNHttpClientConnectio
             }
             if (this.contentDecoder != null) {
                 handler.inputReady(this, this.contentDecoder);
+                if (this.session.isClosed()) {
+                    return;
+                }
                 if (this.contentDecoder.isCompleted()) {
                     // Response entity received
                     // Ready to receive a new response

Modified: httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java?rev=1209164&r1=1209163&r2=1209164&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
(original)
+++ httpcomponents/httpcore/branches/4.1.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Thu Dec  1 17:31:09 2011
@@ -161,6 +161,9 @@ public class DefaultNHttpServerConnectio
                     }
                     this.connMetrics.incrementRequestCount();
                     handler.requestReceived(this);
+                    if (this.session.isClosed()) {
+                        return;
+                    }
                     if (this.contentDecoder == null) {
                         // No request entity is expected
                         // Ready to receive a new request
@@ -173,6 +176,9 @@ public class DefaultNHttpServerConnectio
             }
             if (this.contentDecoder != null) {
                 handler.inputReady(this, this.contentDecoder);
+                if (this.session.isClosed()) {
+                    return;
+                }
                 if (this.contentDecoder.isCompleted()) {
                     // Request entity received
                     // Ready to receive a new request



Mime
View raw message