diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/Link.cpp | 20 | ||||
-rw-r--r-- | cpp/src/qpid/broker/LinkRegistry.cpp | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 297c5e22a9..84dd163ac3 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -249,17 +249,19 @@ void Link::established(Connection* c) if (!hideManagement() && agent) agent->raiseEvent(_qmf::EventBrokerLinkUp(addr.str())); - - Mutex::ScopedLock mutex(lock); - setStateLH(STATE_OPERATIONAL); - currentInterval = 1; - visitCount = 0; - connection = c; - - if (closing) + bool isClosing = false; + { + Mutex::ScopedLock mutex(lock); + setStateLH(STATE_OPERATIONAL); + currentInterval = 1; + visitCount = 0; + connection = c; + isClosing = closing; + } + if (isClosing) destroy(); else // Process any IO tasks bridges added before established. - connection->requestIOProcessing (boost::bind(&Link::ioThreadProcessing, this)); + c->requestIOProcessing (boost::bind(&Link::ioThreadProcessing, this)); } diff --git a/cpp/src/qpid/broker/LinkRegistry.cpp b/cpp/src/qpid/broker/LinkRegistry.cpp index 75c311c917..31b113c4d9 100644 --- a/cpp/src/qpid/broker/LinkRegistry.cpp +++ b/cpp/src/qpid/broker/LinkRegistry.cpp @@ -326,13 +326,13 @@ void LinkRegistry::notifyConnection(const std::string& key, Connection* c) if (l->second->pendingConnection(host, port)) { link = l->second; connections[key] = link->getName(); - link->established(c); break; } } } if (link) { + link->established(c); c->setUserId(str(format("%1%@%2%") % link->getUsername() % realm)); } } |