From 541133bd1888fd527abb8780b2216f919244c797 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 21 Apr 2008 20:34:49 +0000 Subject: * raise error when controls other than attached are received on unattached channel * corrected exception handling in client and on broker (broker to issue detach) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650250 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/SessionImpl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/client/SessionImpl.cpp') diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index 4e3f6cdd98..190141c411 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -426,9 +426,12 @@ void SessionImpl::attached(const std::string& _name) setState(ATTACHED); } -void SessionImpl::detach(const std::string& /*name*/) +void SessionImpl::detach(const std::string& _name) { - throw NotImplementedException("Client does not support detach"); + Lock l(state); + if (name != _name) throw InternalErrorException("Incorrect session name"); + setState(DETACHED); + QPID_LOG(info, "Session detached by peer: " << name); } void SessionImpl::detached(const std::string& _name, uint8_t _code) @@ -561,7 +564,6 @@ void SessionImpl::exception(uint16_t errorCode, //should we wait for the timeout response? detachedLifetime = 0; } - detach(); } -- cgit v1.2.1