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 2016/11/30 21:22:23 UTC

qpid-dispatch git commit: DISPATCH-506 - Set closed=false for "lost" links. Also work around an anomaly in Proton. Proton does not mark links as closed (remote or local) when the link is detached. The workaround is to call pn_link_detach followed by pn

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 5ec550b67 -> 3f4bc69b5


DISPATCH-506 - Set closed=false for "lost" links.  Also work around an anomaly in Proton.
Proton does not mark links as closed (remote or local) when the link is detached.  The
workaround is to call pn_link_detach followed by pn_link_close for detaching and to
assume that the remote state is closed when handling a PN_LINK_REMOTE_DETACH event.


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

Branch: refs/heads/master
Commit: 3f4bc69b580665d7f763737966289d76c6d379ef
Parents: 5ec550b
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Nov 30 16:20:32 2016 -0500
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Nov 30 16:20:32 2016 -0500

----------------------------------------------------------------------
 src/container.c               | 11 ++++++-----
 src/router_core/connections.c |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/3f4bc69b/src/container.c
----------------------------------------------------------------------
diff --git a/src/container.c b/src/container.c
index 5430356..5103a66 100644
--- a/src/container.c
+++ b/src/container.c
@@ -431,8 +431,8 @@ int pn_event_handler(void *handler_context, void *conn_context, pn_event_t *even
         }
         break;
 
-    case PN_LINK_REMOTE_CLOSE :
     case PN_LINK_REMOTE_DETACH :
+    case PN_LINK_REMOTE_CLOSE :
         if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) {
             pn_link = pn_event_link(event);
             qd_link = (qd_link_t*) pn_link_get_context(pn_link);
@@ -461,10 +461,9 @@ int pn_event_handler(void *handler_context, void *conn_context, pn_event_t *even
                     }
                 }
 
-                if (pn_link_state(pn_link) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED)) {
-                    if (qd_link->close_sess_with_link && sess) {
+                if (pn_link_state(pn_link) & PN_LOCAL_CLOSED) {
+                    if (qd_link->close_sess_with_link && sess)
                         pn_session_close(sess);
-                    }
                     pn_link_free(pn_link);
                 }
             }
@@ -892,8 +891,10 @@ void qd_link_close(qd_link_t *link)
 
 void qd_link_detach(qd_link_t *link)
 {
-    if (link->pn_link)
+    if (link->pn_link) {
         pn_link_detach(link->pn_link);
+        pn_link_close(link->pn_link);
+    }
 
     if (link->close_sess_with_link && link->pn_sess &&
         pn_link_state(link->pn_link) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED)) {

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/3f4bc69b/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 1e6f054..132be85 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -1288,7 +1288,7 @@ static void qdr_link_inbound_detach_CT(qdr_core_t *core, qdr_action_t *action, b
         if (dt != QD_LOST)
             qdr_link_outbound_detach_CT(core, link->connected_link, error, QDR_CONDITION_NONE, dt == QD_CLOSED);
         else
-            qdr_link_outbound_detach_CT(core, link->connected_link, 0, QDR_CONDITION_ROUTED_LINK_LOST, true);
+            qdr_link_outbound_detach_CT(core, link->connected_link, 0, QDR_CONDITION_ROUTED_LINK_LOST, false);
 
         //
         // If the link is completely detached, release its resources


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