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 2019/04/05 13:30:51 UTC

[qpid-dispatch] branch master updated: DISPATCH-1309 - Repurposed unused qd_connection_t.closed flag to prevent writable processing on closed connections. This closes #481

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

tross 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 57c3603  DISPATCH-1309 - Repurposed unused qd_connection_t.closed flag to prevent writable processing on closed connections. This closes #481
57c3603 is described below

commit 57c3603c427a44d7d1a4490650a622d67a1ef7d6
Author: Ted Ross <tr...@redhat.com>
AuthorDate: Thu Apr 4 16:57:18 2019 -0400

    DISPATCH-1309 - Repurposed unused qd_connection_t.closed flag to prevent writable processing on closed connections.
    This closes #481
---
 src/container.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/container.c b/src/container.c
index 410bae4..22a4286 100644
--- a/src/container.c
+++ b/src/container.c
@@ -307,6 +307,8 @@ static int close_handler(qd_container_t *container, pn_connection_t *conn, qd_co
     // Close all links, passing QD_LOST as the reason.  These links are not
     // being properly 'detached'.  They are being orphaned.
     //
+    if (qd_conn)
+        qd_conn->closed = true;
     close_links(container, conn, true);
     notify_closed(container, qd_conn, qd_connection_get_context(qd_conn));
     return 0;
@@ -453,6 +455,8 @@ void qd_container_handle_event(qd_container_t *container, pn_event_t *event,
         break;
 
     case PN_CONNECTION_REMOTE_CLOSE :
+        if (qd_conn)
+            qd_conn->closed = true;
         if (pn_connection_state(conn) == (PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED)) {
             close_links(container, conn, false);
             pn_connection_close(conn);
@@ -647,7 +651,8 @@ void qd_container_handle_event(qd_container_t *container, pn_event_t *event,
         break;
 
     case PN_CONNECTION_WAKE:
-        writable_handler(container, conn, qd_conn);
+        if (!qd_conn->closed)
+            writable_handler(container, conn, qd_conn);
         break;
 
     case PN_TRANSPORT_CLOSED:
@@ -970,7 +975,7 @@ qd_connection_t *qd_link_connection(qd_link_t *link)
         return 0;
 
     qd_connection_t *ctx = pn_connection_get_context(conn);
-    if (!ctx || !ctx->opened || ctx->closed)
+    if (!ctx || !ctx->opened)
         return 0;
 
     return ctx;


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