You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2018/04/11 22:59:13 UTC

qpid-dispatch git commit: DISPATCH-962 - Ensure that link termini are not present when an attach is rejected.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 0ad6e6ff5 -> 9411270f3


DISPATCH-962 - Ensure that link termini are not present when an attach is rejected.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/9411270f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/9411270f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/9411270f

Branch: refs/heads/master
Commit: 9411270f301bde9197c1f55b387f2980a6d63aa5
Parents: 0ad6e6f
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Apr 11 18:58:18 2018 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Apr 11 18:58:18 2018 -0400

----------------------------------------------------------------------
 src/router_node.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9411270f/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index 719af5a..4e73105 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -1200,6 +1200,18 @@ static void CORE_link_detach(void *context, qdr_link_t *link, qdr_error_t *error
         qdr_error_copy(error, cond);
     }
 
+    //
+    // If the link is only half open, then this DETACH constitutes the rejection of
+    // an incoming ATTACH.  We must nullify the source and target in order to be
+    // compliant with the AMQP specification.  This is because Proton will generate
+    // the missing ATTACH before the DETACH and will include spurious terminus data
+    // if we don't nullify it here.
+    //
+    if (pn_link_state(pn_link) & PN_LOCAL_UNINIT) {
+        pn_terminus_set_type(pn_link_source(pn_link), PN_UNSPECIFIED);
+        pn_terminus_set_type(pn_link_target(pn_link), PN_UNSPECIFIED);
+    }
+
     if (close)
         qd_link_close(qlink);
     else


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org