diff options
| author | Gordon Sim <gsim@apache.org> | 2008-09-30 18:46:31 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-09-30 18:46:31 +0000 |
| commit | e6e650d866bdeadc7482c6295039c8162e8e480d (patch) | |
| tree | 163fad4ee6a32d178841602ed7966fe904c097c9 /qpid/cpp | |
| parent | b114ea977d82a8dce318c084b9b64253e26f109f (diff) | |
| download | qpid-python-e6e650d866bdeadc7482c6295039c8162e8e480d.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@700545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/QueuePolicy.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/QueuePolicy.cpp b/qpid/cpp/src/qpid/broker/QueuePolicy.cpp index c8980b8b4d..aefb87a392 100644 --- a/qpid/cpp/src/qpid/broker/QueuePolicy.cpp +++ b/qpid/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) { |
