From e7998631f9c479dd659f409f8e38c910e0028858 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 15 Apr 2015 20:18:55 +0000 Subject: 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 --- qpid/cpp/src/qpid/broker/amqp/Session.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'qpid/cpp') 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; + } } } -- cgit v1.2.1