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 | e7998631f9c479dd659f409f8e38c910e0028858 (patch) | |
tree | c927e4ec6c73bf32a7cea74f0825c5f650d1ff78 | |
parent | 20b83f12939c0d68e2dfff92637de900ada654dd (diff) | |
download | qpid-python-e7998631f9c479dd659f409f8e38c910e0028858.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@1673949 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Session.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp index 9cd6aae26f..24da9e0fec 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp +++ b/qpid/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; + } } } |