copy terminus for which peer is authoritative when refusing link
@@ -1449,10 +1449,13 @@ static void CORE_link_detach(void *context, qdr_link_t *link, qdr_error_t *error
// if we don't nullify it here.
//
if (pn_link_state(pn_link) & PN_LOCAL_UNINIT) {
- if (pn_link_is_receiver(pn_link))
+ if (pn_link_is_receiver(pn_link)) {
pn_terminus_set_type(pn_link_target(pn_link), PN_UNSPECIFIED);
- else
+ pn_terminus_copy(pn_link_source(pn_link), pn_link_remote_source(pn_link));
+ } else {
pn_terminus_set_type(pn_link_source(pn_link), PN_UNSPECIFIED);
+ pn_terminus_copy(pn_link_target(pn_link), pn_link_remote_target(pn_link));
+ }
}
if (close)
