hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [05/34] httpcomponents-core git commit: Post HTTPCORE-370 minor code optimization
Date Tue, 09 May 2017 20:02:34 GMT
Post HTTPCORE-370 minor code optimization

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.3.x@1563154
13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f6abb438
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f6abb438
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f6abb438

Branch: refs/heads/4.3.x
Commit: f6abb4384c3ada188c1d991118ba6202a65f9a46
Parents: 24a0c3d
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Fri Jan 31 15:52:51 2014 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Fri Jan 31 15:52:51 2014 +0000

----------------------------------------------------------------------
 .../http/impl/nio/reactor/DefaultConnectingIOReactor.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f6abb438/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
index 37fad64..77dbeed 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
@@ -175,9 +175,14 @@ public class DefaultConnectingIOReactor extends AbstractMultiworkerIOReactor
                     sessionRequest.failed(ex);
                 }
                 key.cancel();
-                if (channel.isConnected()) {
+                key.attach(null);
+                if (!sessionRequest.isCompleted()) {
                     addChannel(new ChannelEntry(channel, sessionRequest));
-                    key.attach(null);
+                } else {
+                    try {
+                        channel.close();
+                    } catch (IOException ignore) {
+                    }
                 }
             }
 


Mime
View raw message