From 0319629d9bbd6d3b27329832512dd7690ff4af9c Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 8 Nov 2013 17:41:25 +0000 Subject: QPID-5314: exceptions should not contain full path for paging file git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1540137 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/PagedQueue.cpp | 10 ++++++---- qpid/cpp/src/qpid/broker/PagedQueue.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/broker/PagedQueue.cpp b/qpid/cpp/src/qpid/broker/PagedQueue.cpp index 4063fbe695..58996bd200 100644 --- a/qpid/cpp/src/qpid/broker/PagedQueue.cpp +++ b/qpid/cpp/src/qpid/broker/PagedQueue.cpp @@ -64,8 +64,8 @@ size_t decode(ProtocolRegistry& protocols, Message& msg, const char* data, size_ } -PagedQueue::PagedQueue(const std::string& name, const std::string& directory, uint m, uint factor, ProtocolRegistry& p) - : pageSize(file.getPageSize()*factor), maxLoaded(m), protocols(p), offset(0), loaded(0), version(0) +PagedQueue::PagedQueue(const std::string& name_, const std::string& directory, uint m, uint factor, ProtocolRegistry& p) + : name(name_), pageSize(file.getPageSize()*factor), maxLoaded(m), protocols(p), offset(0), loaded(0), version(0) { path = file.open(name, directory); QPID_LOG(debug, "PagedQueue[" << path << "]"); @@ -104,7 +104,8 @@ bool PagedQueue::deleted(const QueueCursor& cursor) void PagedQueue::publish(const Message& added) { if (encodedSize(added) > pageSize) { - throw qpid::framing::PreconditionFailedException(QPID_MSG("Message is larger than page size for queue backed by " << path)); + QPID_LOG(error, "Message is larger than page size for queue " << name << ", backed by " << path); + throw qpid::framing::PreconditionFailedException(QPID_MSG("Message is larger than page size for queue " << name)); } Used::reverse_iterator i = used.rbegin(); if (i != used.rend()) { @@ -113,7 +114,8 @@ void PagedQueue::publish(const Message& added) } //used is empty or last page is full, need to add a new page if (!newPage(added.getSequence()).add(added)) { - throw qpid::Exception(QPID_MSG("Could not add message to paged queue backed by " << path)); + QPID_LOG(error, "Could not add message to paged queue " << name << ", backed by " << path); + throw qpid::Exception(QPID_MSG("Could not add message to paged queue " << name)); } } diff --git a/qpid/cpp/src/qpid/broker/PagedQueue.h b/qpid/cpp/src/qpid/broker/PagedQueue.h index fe38c45ce8..4bb4953ba6 100644 --- a/qpid/cpp/src/qpid/broker/PagedQueue.h +++ b/qpid/cpp/src/qpid/broker/PagedQueue.h @@ -75,6 +75,7 @@ class PagedQueue : public Messages { }; qpid::sys::MemoryMappedFile file; + std::string name; std::string path; const size_t pageSize; const uint maxLoaded; -- cgit v1.2.1