From e919b8ae21a9a92bdea636c7c5de34bda1c29a3d Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 27 Mar 2007 21:23:40 +0000 Subject: * cpp/tests/BrokerChannelTest.cpp: Fix leak. * cpp/lib/broker/Connection.h: signature fix, pass const& instead of *. * cpp/lib/client/IncomingMessage.cpp: Correct error codes. * cpp/lib/broker/Reference.cpp: Fix TODO. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@523085 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/client/IncomingMessage.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cpp/lib/client/IncomingMessage.cpp') diff --git a/cpp/lib/client/IncomingMessage.cpp b/cpp/lib/client/IncomingMessage.cpp index 8f69f8c3ef..fb9640b61b 100644 --- a/cpp/lib/client/IncomingMessage.cpp +++ b/cpp/lib/client/IncomingMessage.cpp @@ -35,8 +35,8 @@ IncomingMessage::Destination::~Destination() {} void IncomingMessage::openReference(const std::string& name) { Mutex::ScopedLock l(lock); if (references.find(name) != references.end()) - throw ChannelException( - 406, format("Attempt to open existing reference %s.") % name); + throw ConnectionException( + 503, format("Attempt to open existing reference %s.") % name); references[name]; return; } @@ -84,16 +84,16 @@ void IncomingMessage::addDestination(std::string name, Destination& dest) { if (i == destinations.end()) destinations[name]=&dest; else if (i->second != &dest) - throw ChannelException( - 404, format("Destination already exists: %s.") % name); + throw ConnectionException( + 503, format("Destination already exists: %s.") % name); } void IncomingMessage::removeDestination(std::string name) { Mutex::ScopedLock l(lock); DestinationMap::iterator i = destinations.find(name); if (i == destinations.end()) - throw ChannelException( - 406, format("No such destination: %s.") % name); + throw ConnectionException( + 503, format("No such destination: %s.") % name); destinations.erase(i); } @@ -112,8 +112,8 @@ IncomingMessage::Reference& IncomingMessage::getRefUnlocked( Mutex::ScopedLock l(lock); ReferenceMap::iterator i = references.find(name); if (i == references.end()) - throw ChannelException( - 404, format("No such reference: %s.") % name); + throw ConnectionException( + 503, format("No such reference: %s.") % name); return i->second; } @@ -122,8 +122,8 @@ IncomingMessage::Destination& IncomingMessage::getDestUnlocked( Mutex::ScopedLock l(lock); DestinationMap::iterator i = destinations.find(name); if (i == destinations.end()) - throw ChannelException( - 404, format("No such destination: %s.") % name); + throw ConnectionException( + 503, format("No such destination: %s.") % name); return *i->second; } -- cgit v1.2.1