summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-11-08 17:41:25 +0000
committerGordon Sim <gsim@apache.org>2013-11-08 17:41:25 +0000
commit0319629d9bbd6d3b27329832512dd7690ff4af9c (patch)
treeb1e3ce27146c0985e6f44218946b7032a2b416c7 /qpid/cpp/src
parent84f0acc42b2d9eb71226f26eef526a0e9f7493f3 (diff)
downloadqpid-python-0319629d9bbd6d3b27329832512dd7690ff4af9c.tar.gz
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
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/PagedQueue.cpp10
-rw-r--r--qpid/cpp/src/qpid/broker/PagedQueue.h1
2 files changed, 7 insertions, 4 deletions
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;