diff options
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Link.cpp | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp index ab28c5b01f..e354b4e425 100644 --- a/qpid/cpp/src/qpid/broker/Link.cpp +++ b/qpid/cpp/src/qpid/broker/Link.cpp @@ -345,36 +345,32 @@ void Link::opened() { void Link::closed(int, std::string text) { - bool isClosing = false; - { - Mutex::ScopedLock mutex(lock); - QPID_LOG (info, "Inter-broker link disconnected from " << host << ":" << port << " " << text); + Mutex::ScopedLock mutex(lock); + QPID_LOG (info, "Inter-broker link disconnected from " << host << ":" << port << " " << text); - connection = 0; - if (state == STATE_OPERATIONAL) { + connection = 0; + + if (!hideManagement()) { + mgmtObject->set_connectionRef(qpid::management::ObjectId()); + if (state == STATE_OPERATIONAL && agent) { stringstream addr; addr << host << ":" << port; - if (!hideManagement() && agent) - agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str())); + agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str())); } + } - for (Bridges::iterator i = active.begin(); i != active.end(); i++) { - (*i)->closed(); - created.push_back(*i); - } - active.clear(); + for (Bridges::iterator i = active.begin(); i != active.end(); i++) { + (*i)->closed(); + created.push_back(*i); + } + active.clear(); - if (state != STATE_FAILED && state != STATE_PASSIVE) - { - setStateLH(STATE_WAITING); - if (!hideManagement()) - mgmtObject->set_lastError (text); - } - mgmtObject->set_connectionRef(qpid::management::ObjectId()); + if (state != STATE_FAILED && state != STATE_PASSIVE) + { + setStateLH(STATE_WAITING); + if (!hideManagement()) + mgmtObject->set_lastError (text); } - // Call destroy outside of the lock, don't want to be deleted with lock held. - if (isClosing) - destroy(); } // Called in connection IO thread, cleans up the connection before destroying Link |
