Author: gsim
Date: Thu Jan 12 11:05:27 2012
New Revision: 1230488
URL: http://svn.apache.org/viewvc?rev=1230488&view=rev
Log:
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).
Modified:
qpid/branches/qpid-3603/qpid/cpp/src/qpid/broker/Link.cpp
Modified: qpid/branches/qpid-3603/qpid/cpp/src/qpid/broker/Link.cpp
URL:
http://svn.apache.org/viewvc/qpid/branches/qpid-3603/qpid/cpp/src/qpid/broker/Link.cpp?rev=1230488&r1=1230487&r2=1230488&view=diff
==============================================================================
--- qpid/branches/qpid-3603/qpid/cpp/src/qpid/broker/Link.cpp (original)
+++ qpid/branches/qpid-3603/qpid/cpp/src/qpid/broker/Link.cpp Thu Jan 12
11:05:27 2012
@@ -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)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]