summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-09-30 18:46:31 +0000
committerGordon Sim <gsim@apache.org>2008-09-30 18:46:31 +0000
commit36c6fd0e309149de2ede18b7f6f1c11884c8ab13 (patch)
treec849a1301a81623d8142b53e3145ff999df5fa6d /cpp/src
parent1152ab5026d755b00c6097be77d811e6adf37fb3 (diff)
downloadqpid-python-36c6fd0e309149de2ede18b7f6f1c11884c8ab13.tar.gz
Handle case where first message in 'ring queue' would exceed limit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@700545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/QueuePolicy.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/QueuePolicy.cpp b/cpp/src/qpid/broker/QueuePolicy.cpp
index c8980b8b4d..aefb87a392 100644
--- a/cpp/src/qpid/broker/QueuePolicy.cpp
+++ b/cpp/src/qpid/broker/QueuePolicy.cpp
@@ -176,6 +176,13 @@ bool RingQueuePolicy::checkLimit(const QueuedMessage& m)
QueuedMessage oldest;
{
qpid::sys::Mutex::ScopedLock l(lock);
+ if (queue.empty()) {
+ QPID_LOG(debug, "Message too large for ring queue "
+ << (m.queue ? m.queue->getName() : std::string("unknown queue"))
+ << " [" << *this << "] "
+ << ": message size = " << m.payload->contentSize() << " bytes");
+ return false;
+ }
oldest = queue.front();
}
if (oldest.queue->acquire(oldest) || !strict) {