diff options
| author | Gordon Sim <gsim@apache.org> | 2015-04-15 20:18:55 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2015-04-15 20:18:55 +0000 |
| commit | 12ad7fe27cf4316215a9cddc1e1a1afac176c234 (patch) | |
| tree | 3b86d565b236395a039fdaa657d988bf6c540605 | |
| parent | e4d9d789888b75c38f8051196d6be02d673da6eb (diff) | |
| download | qpid-python-12ad7fe27cf4316215a9cddc1e1a1afac176c234.tar.gz | |
QPID-6492: make sure local terminus is null in the attache we send back if it will be immediately followed by a detach due to error
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1673949 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | cpp/src/qpid/broker/amqp/Session.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/amqp/Session.cpp b/cpp/src/qpid/broker/amqp/Session.cpp index 9cd6aae26f..24da9e0fec 100644 --- a/cpp/src/qpid/broker/amqp/Session.cpp +++ b/cpp/src/qpid/broker/amqp/Session.cpp @@ -400,7 +400,12 @@ void Session::attach(pn_link_t* link) pn_terminus_set_address(pn_link_source(link), name.c_str()); } - setupOutgoing(link, source, name); + try { + setupOutgoing(link, source, name); + } catch (const std::exception&) { + pn_terminus_set_type(pn_link_source(link), PN_UNSPECIFIED); + throw; + } } else { pn_terminus_t* target = pn_link_remote_target(link); std::string name; @@ -422,7 +427,12 @@ void Session::attach(pn_link_t* link) pn_terminus_set_address(pn_link_target(link), name.c_str()); } - setupIncoming(link, target, name); + try { + setupIncoming(link, target, name); + } catch (const std::exception&) { + pn_terminus_set_type(pn_link_target(link), PN_UNSPECIFIED); + throw; + } } } |
