summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-01-12 11:05:27 +0000
committerGordon Sim <gsim@apache.org>2012-01-12 11:05:27 +0000
commit6826f7d6caf560e8443bc1b75c6b0c4b0e3d7894 (patch)
tree8ea2386179c8d130c79aff8b90a0ec88d4ad1c56
parentaa52fb4a964f39128b3d52618f5ab44d94d37628 (diff)
downloadqpid-python-6826f7d6caf560e8443bc1b75c6b0c4b0e3d7894.tar.gz
QPID-3603: Act on bridge cancellations before creations
This ensures that recreation of a bridge does not result in two active subscriptions (evench can cause confusion for replicators, even if they are both active only for a very short period). git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3603@1230488 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/Link.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp
index de965e805d..314b97daf1 100644
--- a/qpid/cpp/src/qpid/broker/Link.cpp
+++ b/qpid/cpp/src/qpid/broker/Link.cpp
@@ -265,7 +265,15 @@ void Link::ioThreadProcessing()
active.erase(removed, active.end());
}
- //process any pending creates and/or cancellations
+ //process any pending creates and/or cancellations (do
+ //cancellations first in case any of the creates represent
+ //recreation of cancelled subscriptions
+ if (!cancellations.empty()) {
+ for (Bridges::iterator i = cancellations.begin(); i != cancellations.end(); ++i) {
+ (*i)->cancel(*connection);
+ }
+ cancellations.clear();
+ }
if (!created.empty()) {
for (Bridges::iterator i = created.begin(); i != created.end(); ++i) {
active.push_back(*i);
@@ -273,12 +281,6 @@ void Link::ioThreadProcessing()
}
created.clear();
}
- if (!cancellations.empty()) {
- for (Bridges::iterator i = cancellations.begin(); i != cancellations.end(); ++i) {
- (*i)->cancel(*connection);
- }
- cancellations.clear();
- }
}
void Link::setConnection(Connection* c)