hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1038320 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
Date Tue, 23 Nov 2010 20:21:26 GMT
Author: olegk
Date: Tue Nov 23 20:21:26 2010
New Revision: 1038320

URL: http://svn.apache.org/viewvc?rev=1038320&view=rev
Log:
HTTPCORE-242: follow-up patch: close invalid connection prior to calling .execHandler#handleResponse

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java?rev=1038320&r1=1038319&r2=1038320&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
Tue Nov 23 20:21:26 2010
@@ -408,14 +408,18 @@ public class AsyncNHttpClientHandler ext
             final NHttpClientConnection conn,
             final ClientConnState connState) throws IOException, HttpException {
 
+        if (!connState.isValid()) {
+            conn.close();
+        }
+
         HttpContext context = conn.getContext();
         HttpResponse response = connState.getResponse();
-
         this.execHandler.handleResponse(response, context);
-
-        if (!connState.isValid() || !this.connStrategy.keepAlive(response, context)) {
+        if (!this.connStrategy.keepAlive(response, context)) {
             conn.close();
-        } else {
+        }
+
+        if (conn.isOpen()) {
             // Ready for another request
             connState.resetInput();
             connState.resetOutput();



Mime
View raw message