diff options
author | Gordon Sim <gsim@apache.org> | 2009-02-12 20:01:32 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-02-12 20:01:32 +0000 |
commit | 2373179461b356f540dacd27d0fd7413b0a550e2 (patch) | |
tree | 59e8bfc0fa4c94fe5c9b2419f41ef5f85e1dd0a1 /cpp/src/qpid/broker/Queue.cpp | |
parent | aa5e03ba82f2c42e2e89466468e03209bd31cee3 (diff) | |
download | qpid-python-2373179461b356f540dacd27d0fd7413b0a550e2.tar.gz |
Queue::checkLvqReplace() needs to update the lvq map if it makes a replacement or the map will contain a pointer to a stale message and further updates will be lost.
Also added in locking to set-/get- ReplacementMessage() in Message.cpp
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@743857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index c9ee7f394f..bcce83af1e 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -587,10 +587,19 @@ QueuedMessage Queue::getFront() return msg; } -QueuedMessage& Queue::checkLvqReplace(QueuedMessage& msg) const +QueuedMessage& Queue::checkLvqReplace(QueuedMessage& msg) { boost::intrusive_ptr<Message> replacement = msg.payload->getReplacementMessage(this); - if (replacement.get()) msg.payload = replacement; + if (replacement.get()) { + const framing::FieldTable* ft = replacement->getApplicationHeaders(); + if (ft) { + string key = ft->getAsString(qpidVQMatchProperty); + if (lvq.find(key) != lvq.end()){ + lvq[key] = replacement; + } + } + msg.payload = replacement; + } return msg; } |