summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Queue.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-02-13 19:21:21 +0000
committerGordon Sim <gsim@apache.org>2009-02-13 19:21:21 +0000
commit858b69ff7c0ad5bf938e3817497a1b7953bf76d5 (patch)
tree4a86049e3d957c36998679421dc05d39da81787d /cpp/src/qpid/broker/Queue.cpp
parent499864a7738f2c099f02eeac53a6620d20ddf487 (diff)
downloadqpid-python-858b69ff7c0ad5bf938e3817497a1b7953bf76d5.tar.gz
Ensure that the queue depth in bytes remains accurate for LVQ. This also ensures that there are no underflow exceptions from the policy that keeps this count.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@744222 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
-rw-r--r--cpp/src/qpid/broker/Queue.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index bcce83af1e..3ae53c8ea9 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -563,8 +563,10 @@ void Queue::push(boost::intrusive_ptr<Message>& msg){
listeners.populate(copy);
lvq[key] = msg;
}else {
+ boost::intrusive_ptr<Message> old = i->second->getReplacementMessage(this);
+ if (!old) old = i->second;
i->second->setReplacementMessage(msg,this);
- dequeued(QueuedMessage(qm.queue, i->second, qm.position));
+ dequeued(QueuedMessage(qm.queue, old, qm.position));
}
}else {
messages.push_back(qm);