summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/DirectExchange.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
commit5644e4fbfd777921b33874aed13c45d544c8a383 (patch)
tree7f9f1527a43f46ff92a43088ac13d0faf6224719 /cpp/src/qpid/broker/DirectExchange.cpp
parentbf54dc92bf7d46862cbef3113314b7b16797d92e (diff)
downloadqpid-python-5644e4fbfd777921b33874aed13c45d544c8a383.tar.gz
Feature requested by AndrewM for M4...
- provide initial value support, for late joining consumers git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/DirectExchange.cpp')
-rw-r--r--cpp/src/qpid/broker/DirectExchange.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/cpp/src/qpid/broker/DirectExchange.cpp b/cpp/src/qpid/broker/DirectExchange.cpp
index f760bc9747..8fc8260f9e 100644
--- a/cpp/src/qpid/broker/DirectExchange.cpp
+++ b/cpp/src/qpid/broker/DirectExchange.cpp
@@ -43,17 +43,20 @@ DirectExchange::DirectExchange(const std::string& _name, bool _durable,
}
bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable*){
- Mutex::ScopedLock l(lock);
- Binding::shared_ptr b(new Binding (routingKey, queue, this));
- if (bindings[routingKey].add_unless(b, MatchQueue(queue))) {
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
+ {
+ Mutex::ScopedLock l(lock);
+ Binding::shared_ptr b(new Binding (routingKey, queue, this));
+ if (bindings[routingKey].add_unless(b, MatchQueue(queue))) {
+ if (mgmtExchange != 0) {
+ mgmtExchange->inc_bindingCount();
+ ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
+ }
+ } else {
+ return false;
}
- return true;
- } else {
- return false;
}
+ routeIVE();
+ return true;
}
bool DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){