You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2020/04/24 18:12:11 UTC

[qpid-dispatch] branch master updated: DISPATCH-1628: if connection locally closed then stop all link rcvs

This is an automated email from the ASF dual-hosted git repository.

chug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 6a4eea7  DISPATCH-1628: if connection locally closed then stop all link rcvs
6a4eea7 is described below

commit 6a4eea7fe639aa5e5eae7bfdd811286405b0dd78
Author: Chuck Rolke <ch...@apache.org>
AuthorDate: Fri Apr 24 13:47:44 2020 -0400

    DISPATCH-1628: if connection locally closed then stop all link rcvs
    
    This closes #726
---
 src/router_node.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/router_node.c b/src/router_node.c
index 2d28599..5c14ca0 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -328,6 +328,12 @@ static bool AMQP_rx_handler(void* context, qd_link_t *link)
         return false;
 
     qd_connection_t  *conn   = qd_link_connection(link);
+
+    // DISPATCH-1628 DISPATCH-975 exit if router already closed this connection
+    if (conn->closed) {
+        return false;
+    }
+
     qdr_delivery_t *delivery = qdr_node_delivery_qdr_from_pn(pnd);
     bool       next_delivery = false;
 
@@ -396,6 +402,8 @@ static bool AMQP_rx_handler(void* context, qd_link_t *link)
             // reject and settle the incoming delivery
             pn_delivery_update(pnd, PN_REJECTED);
             pn_delivery_settle(pnd);
+            // close the link
+            pn_link_close(pn_link);
             // close the connection
             pn_connection_t * pn_conn = qd_connection_pn(conn);
             pn_condition_t * cond = pn_connection_condition(pn_conn);
@@ -407,6 +415,8 @@ static bool AMQP_rx_handler(void* context, qd_link_t *link)
                 // cleaned up when the link is freed.
                 qd_message_free(msg);
             }
+            // stop activity on this connection
+            conn->closed = true;
         }
         return false;
         // oversize messages are not processed any further


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