summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-06-04 16:52:26 +0000
committerTed Ross <tross@apache.org>2008-06-04 16:52:26 +0000
commit656a4f3d5fcea275f954e3d1c9eaa5087a2e7005 (patch)
tree19904905799a1784c1d75044cdbf2bef32c0fef4 /cpp/src
parentd1f99cede240ade9532da4fe5061a177c5c63f33 (diff)
downloadqpid-python-656a4f3d5fcea275f954e3d1c9eaa5087a2e7005.tar.gz
QPID-1121
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@663304 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/Link.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp
index 08b9d8fe3e..630ce68150 100644
--- a/cpp/src/qpid/broker/Link.cpp
+++ b/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());