qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject qpid-dispatch git commit: DISPATCH-895 - Check if underlying proton links are not closed before calling into proton. The underlying links/sessions on a connection are cleaned up silently by proton when a connection drops.
Date Fri, 16 Feb 2018 19:08:34 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/1.0.x 0e76f1512 -> 9fb1b6309


DISPATCH-895 - Check if underlying proton links are not closed before calling into proton.
The underlying links/sessions on a connection are cleaned up silently by proton when a connection
drops.

(cherry picked from commit 7ff1f32372b13f1de9073e7572f1200b167de852)


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

Branch: refs/heads/1.0.x
Commit: 9fb1b63098179e88966f3e14efb0b51fd8e8f982
Parents: 0e76f15
Author: Ganesh Murthy <gmurthy@redhat.com>
Authored: Thu Dec 7 09:56:49 2017 -0500
Committer: Ganesh Murthy <gmurthy@redhat.com>
Committed: Fri Feb 16 14:02:12 2018 -0500

----------------------------------------------------------------------
 src/router_node.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9fb1b630/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index fc9235a..5251c0a 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -1414,6 +1414,10 @@ static void CORE_delivery_update(void *context, qdr_delivery_t *dlv,
uint64_t di
     if (!pnd)
         return;
 
+    // If the delivery's link is somehow gone (maybe because of a connection drop, we don't
proceed.
+    if (!pn_delivery_link(pnd))
+        return;
+
     qdr_error_t *error = qdr_delivery_error(dlv);
 
     if (error) {
@@ -1429,6 +1433,22 @@ static void CORE_delivery_update(void *context, qdr_delivery_t *dlv,
uint64_t di
         free(description);
     }
 
+    qdr_link_t *qlink = qdr_delivery_link(dlv);
+    qd_link_t *link = 0;
+
+    if (qlink) {
+        link = (qd_link_t*) qdr_link_get_context(qlink);
+        if (link) {
+            qd_connection_t  *conn     = qd_link_connection(link);
+            if (conn == 0)
+                return;
+        }
+        else
+            return;
+    }
+    else
+        return;
+
     //
     // If the disposition has changed, update the proton delivery.
     //
@@ -1444,8 +1464,6 @@ static void CORE_delivery_update(void *context, qdr_delivery_t *dlv,
uint64_t di
     // If the delivery is settled, remove the linkage and settle the proton delivery.
     //
     if (settled) {
-        qdr_link_t *qlink = qdr_delivery_link(dlv);
-        qd_link_t  *link  = (qd_link_t*) qdr_link_get_context(qlink);
         qdr_node_disconnect_deliveries(router->router_core, link, dlv, pnd);
         pn_delivery_settle(pnd);
     }


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


Mime
View raw message