You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/11/16 19:44:59 UTC
qpid-cpp git commit: QPID-7991: Segfault in broker while processing
active bridges
Repository: qpid-cpp
Updated Branches:
refs/heads/master 8ca906bc3 -> ab748b4d4
QPID-7991: Segfault in broker while processing active bridges
Fixed incorrect use of std::remove_if while cleaning up detached bridges.
Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/ab748b4d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/ab748b4d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/ab748b4d
Branch: refs/heads/master
Commit: ab748b4d4c03703556e850f821e872bb0f03a004
Parents: 8ca906b
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Nov 16 12:20:10 2017 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Nov 16 12:21:03 2017 -0500
----------------------------------------------------------------------
src/qpid/broker/Link.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/ab748b4d/src/qpid/broker/Link.cpp
----------------------------------------------------------------------
diff --git a/src/qpid/broker/Link.cpp b/src/qpid/broker/Link.cpp
index 037d1e1..14737e7 100644
--- a/src/qpid/broker/Link.cpp
+++ b/src/qpid/broker/Link.cpp
@@ -458,14 +458,16 @@ void Link::ioThreadProcessing()
// check for bridge session errors and recover
if (!active.empty()) {
- Bridges::iterator removed = std::remove_if(
- active.begin(), active.end(), boost::bind(&Bridge::isDetached, _1));
- for (Bridges::iterator i = removed; i != active.end(); ++i) {
+ for (Bridges::iterator i = active.begin(); i != active.end(); ++i) {
Bridge::shared_ptr bridge = *i;
- bridge->closed();
- bridge->cancel(*connection);
- created.push_back(bridge);
+ if (bridge->isDetached()) {
+ bridge->closed();
+ bridge->cancel(*connection);
+ created.push_back(bridge);
+ }
}
+ Bridges::iterator removed = std::remove_if(
+ active.begin(), active.end(), boost::bind(&Bridge::isDetached, _1));
active.erase(removed, active.end());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org