From 858b69ff7c0ad5bf938e3817497a1b7953bf76d5 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 13 Feb 2009 19:21:21 +0000 Subject: 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 --- cpp/src/qpid/broker/Queue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/broker/Queue.cpp') 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& msg){ listeners.populate(copy); lvq[key] = msg; }else { + boost::intrusive_ptr 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); -- cgit v1.2.1