Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E7E910A94 for ; Fri, 31 Jan 2014 15:53:14 +0000 (UTC) Received: (qmail 56658 invoked by uid 500); 31 Jan 2014 15:53:13 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 56608 invoked by uid 500); 31 Jan 2014 15:53:13 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 56596 invoked by uid 99); 31 Jan 2014 15:53:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jan 2014 15:53:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jan 2014 15:53:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B83442388868 for ; Fri, 31 Jan 2014 15:52:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1563154 - /httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java Date: Fri, 31 Jan 2014 15:52:51 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140131155251.B83442388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Fri Jan 31 15:52:51 2014 New Revision: 1563154 URL: http://svn.apache.org/r1563154 Log: Post HTTPCORE-370 minor code optimization Modified: httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java Modified: httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java?rev=1563154&r1=1563153&r2=1563154&view=diff ============================================================================== --- httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java (original) +++ httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java Fri Jan 31 15:52:51 2014 @@ -175,9 +175,14 @@ public class DefaultConnectingIOReactor 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) { + } } }