Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-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 034CF8877 for ; Mon, 22 Aug 2011 21:54:25 +0000 (UTC) Received: (qmail 30073 invoked by uid 500); 22 Aug 2011 21:54:24 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 30028 invoked by uid 500); 22 Aug 2011 21:54:24 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 30021 invoked by uid 99); 22 Aug 2011 21:54:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2011 21:54:24 +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; Mon, 22 Aug 2011 21:54:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E65362388847 for ; Mon, 22 Aug 2011 21:54:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1160458 - /qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp Date: Mon, 22 Aug 2011 21:54:00 -0000 To: commits@qpid.apache.org From: astitcher@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110822215400.E65362388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: astitcher Date: Mon Aug 22 21:54:00 2011 New Revision: 1160458 URL: http://svn.apache.org/viewvc?rev=1160458&view=rev Log: QPID-3447: Creating invalid federation link causes file descriptor leak - Previously we weren't correctly handling synchronous errors when we attempted to connect. Modified: qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp?rev=1160458&r1=1160457&r2=1160458&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp Mon Aug 22 21:54:00 2011 @@ -164,6 +164,7 @@ void AsynchIOProtocolFactory::connect( // shutdown. The allocated AsynchConnector frees itself when it // is no longer needed. Socket* socket = new Socket(); + try { AsynchConnector* c = AsynchConnector::create( *socket, host, @@ -173,6 +174,12 @@ void AsynchIOProtocolFactory::connect( boost::bind(&AsynchIOProtocolFactory::connectFailed, this, _1, _2, _3, failed)); c->start(poller); + } catch (std::exception&) { + // TODO: Design question - should we do the error callback and also throw? + int errCode = socket->getError(); + connectFailed(*socket, errCode, strError(errCode), failed); + throw; + } } }} // namespace qpid::sys --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org