diff options
Diffstat (limited to 'cpp/src/qpid/amqp_0_10/SessionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/amqp_0_10/SessionHandler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp index 8bf12d248a..c9bb57a13e 100644 --- a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp +++ b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp @@ -83,9 +83,7 @@ void SessionHandler::handleIn(AMQFrame& f) { } catch(const ChannelException& e){ QPID_LOG(error, "Channel exception: " << e.what()); - if (getState()) - peer.detached(getState()->getId().getName(), e.code); - channelException(e.code, e.getMessage()); + peer.detached(name, e.code); } catch(const ConnectionException& e) { QPID_LOG(error, "Connection exception: " << e.what()); @@ -126,11 +124,15 @@ void SessionHandler::checkName(const std::string& name) { << ", expecting: " << getState()->getId().getName())); } -void SessionHandler::attach(const std::string& name, bool force) { +void SessionHandler::attach(const std::string& name_, bool force) { + // Save the name for possible session-busy exception. Session-busy + // can be thrown before we have attached the handler to a valid + // SessionState, and in that case we need the name to send peer.detached + name = name_; if (getState() && name == getState()->getId().getName()) return; // Idempotent if (getState()) - throw SessionBusyException( + throw TransportBusyException( QPID_MSG("Channel " << channel.get() << " already attached to " << getState()->getId())); setState(name, force); QPID_LOG(debug, "Attached channel " << channel.get() << " to " << getState()->getId()); |
