Author: tross
Date: Wed Jun 4 09:52:26 2008
New Revision: 663304
URL: http://svn.apache.org/viewvc?rev=663304&view=rev
Log:
QPID-1121
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp?rev=663304&r1=663303&r2=663304&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp Wed Jun 4 09:52:26
2008
@@ -102,9 +102,11 @@
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());