From dd4acef7f90f2351aa8ceace566521b807505614 Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Wed, 6 Jan 2010 21:48:42 +0000 Subject: fix & test QPID-2320 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@896687 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Queue.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cpp/src/qpid') diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index f4231f2397..068ebe3103 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -263,9 +263,10 @@ bool Queue::acquire(const QueuedMessage& msg) { Mutex::ScopedLock locker(messageLock); QPID_LOG(debug, "attempting to acquire " << msg.position); Messages::iterator i = findAt(msg.position); - if ((i != messages.end() && !lastValueQueue) // note that in some cases payload not be set - || (lastValueQueue && (i->position == msg.position) && - msg.payload.get() == checkLvqReplace(*i).payload.get()) ) { + if ((i != messages.end() && i->position == msg.position) && // note that in some cases payload not be set + (!lastValueQueue || + (lastValueQueue && msg.payload.get() == checkLvqReplace(*i).payload.get()) ) // note this is safe for no payload set 0==0 + ) { clearLVQIndex(msg); QPID_LOG(debug, @@ -273,9 +274,7 @@ bool Queue::acquire(const QueuedMessage& msg) { i->position << " == " << msg.position); messages.erase(i); return true; - } else { - QPID_LOG(debug, "No match: " << i->position << " != " << msg.position); - } + } QPID_LOG(debug, "Acquire failed for " << msg.position); return false; -- cgit v1.2.1