From 6e1650a9d8f74166ee499c64daa57e8180e65e27 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 4 Jun 2008 16:52:26 +0000 Subject: QPID-1121 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@663304 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/Link.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp index 08b9d8fe3e..630ce68150 100644 --- a/qpid/cpp/src/qpid/broker/Link.cpp +++ b/qpid/cpp/src/qpid/broker/Link.cpp @@ -102,9 +102,11 @@ void Link::setStateLH (int newState) void Link::startConnectionLH () { try { + // Set the state before calling connect. It is possible that connect + // will fail synchronously and call Link::closed before returning. + setStateLH(STATE_CONNECTING); broker->connect (host, port, useSsl, boost::bind (&Link::closed, this, _1, _2)); - setStateLH(STATE_CONNECTING); } catch(std::exception& e) { setStateLH(STATE_WAITING); mgmtObject->set_lastError (e.what()); -- cgit v1.2.1