diff options
| author | Alan Conway <aconway@apache.org> | 2012-01-18 22:08:45 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-01-18 22:08:45 +0000 |
| commit | e42d55f87498266ee5b25dbe53bf3286dc0b11af (patch) | |
| tree | 9a43a234f0fd51f3da1a25cac19ed24df2f1ce03 /qpid/cpp | |
| parent | 77a6ae21b11dcdd2272a0110816b7e69ff8b6aab (diff) | |
| download | qpid-python-e42d55f87498266ee5b25dbe53bf3286dc0b11af.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/trunk@1233086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Link.cpp | 16 |
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 7e1767fed7..a27cb7c5ac 100644 --- a/qpid/cpp/src/qpid/broker/Link.cpp +++ b/qpid/cpp/src/qpid/broker/Link.cpp @@ -261,7 +261,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); @@ -269,12 +277,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) |
