diff options
| author | Gordon Sim <gsim@apache.org> | 2013-11-08 17:41:25 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-11-08 17:41:25 +0000 |
| commit | ff7fe0ff536089dfe3fe0a3edc5c96b3af8687be (patch) | |
| tree | a76f36837cc3179725e82af7109f63f76c013a9a /cpp/src/qpid | |
| parent | a933320fc3f839dffd4d8fc50f1c028055645d68 (diff) | |
| download | qpid-python-ff7fe0ff536089dfe3fe0a3edc5c96b3af8687be.tar.gz | |
QPID-5314: exceptions should not contain full path for paging file
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1540137 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/broker/PagedQueue.cpp | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/PagedQueue.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/PagedQueue.cpp b/cpp/src/qpid/broker/PagedQueue.cpp index 4063fbe695..58996bd200 100644 --- a/cpp/src/qpid/broker/PagedQueue.cpp +++ b/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/cpp/src/qpid/broker/PagedQueue.h b/cpp/src/qpid/broker/PagedQueue.h index fe38c45ce8..4bb4953ba6 100644 --- a/cpp/src/qpid/broker/PagedQueue.h +++ b/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; |
