diff options
| author | Gordon Sim <gsim@apache.org> | 2008-04-21 20:34:49 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-04-21 20:34:49 +0000 |
| commit | 541133bd1888fd527abb8780b2216f919244c797 (patch) | |
| tree | 2e07858a25ca4f72bb6f5e1a26666ba27207a8d9 /cpp/src/qpid/client/SessionImpl.cpp | |
| parent | c17b3eb2db91a36307905c287ebab6118177caa9 (diff) | |
| download | qpid-python-541133bd1888fd527abb8780b2216f919244c797.tar.gz | |
* 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
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.cpp')
| -rw-r--r-- | cpp/src/qpid/client/SessionImpl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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(); } |
