qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject qpid-dispatch git commit: DISPATCH-179 - Include remote-container-id with open-connection indications to the router core.
Date Wed, 02 Mar 2016 19:27:43 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/tross-DISPATCH-179-1 cad374b1b -> e51dd8c0d


DISPATCH-179 - Include remote-container-id with open-connection indications to the router
core.


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

Branch: refs/heads/tross-DISPATCH-179-1
Commit: e51dd8c0d675a49d93889e80517c21b1fc4cab7f
Parents: cad374b
Author: Ted Ross <tross@redhat.com>
Authored: Wed Mar 2 14:26:37 2016 -0500
Committer: Ted Ross <tross@redhat.com>
Committed: Wed Mar 2 14:26:37 2016 -0500

----------------------------------------------------------------------
 include/qpid/dispatch/router_core.h   |  1 +
 src/router_core/connections.c         | 75 ++++++++++++++++--------------
 src/router_core/router_core_private.h |  1 +
 src/router_node.c                     |  5 +-
 4 files changed, 45 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e51dd8c0/include/qpid/dispatch/router_core.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/router_core.h b/include/qpid/dispatch/router_core.h
index 338c88e..3a8f2b8 100644
--- a/include/qpid/dispatch/router_core.h
+++ b/include/qpid/dispatch/router_core.h
@@ -159,6 +159,7 @@ qdr_connection_t *qdr_connection_opened(qdr_core_t            *core,
                                         bool                   incoming,
                                         qdr_connection_role_t  role,
                                         const char            *label,
+                                        const char            *remote_container_id,
                                         bool                   strip_annotations_in,
                                         bool                   strip_annotations_out);
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e51dd8c0/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 37876d4..58606cf 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -65,6 +65,7 @@ qdr_connection_t *qdr_connection_opened(qdr_core_t            *core,
                                         bool                   incoming,
                                         qdr_connection_role_t  role,
                                         const char            *label,
+                                        const char            *remote_container_id,
                                         bool                   strip_annotations_in,
                                         bool                   strip_annotations_out)
 {
@@ -83,8 +84,9 @@ qdr_connection_t *qdr_connection_opened(qdr_core_t            *core,
     DEQ_INIT(conn->work_list);
     conn->work_lock = sys_mutex();
 
-    action->args.connection.conn  = conn;
-    action->args.connection.label = label;
+    action->args.connection.conn         = conn;
+    action->args.connection.label        = label;
+    action->args.connection.container_id = qdr_field(remote_container_id);
     qdr_action_enqueue(core, action);
 
     return conn;
@@ -687,49 +689,50 @@ static qdr_address_t *qdr_lookup_terminus_address_CT(qdr_core_t    
*core,
 
 static void qdr_connection_opened_CT(qdr_core_t *core, qdr_action_t *action, bool discard)
 {
-    if (discard)
-        return;
-
-    qdr_connection_t *conn = action->args.connection.conn;
-    DEQ_ITEM_INIT(conn);
-    DEQ_INSERT_TAIL(core->open_connections, conn);
-
-    if (conn->role == QDR_ROLE_NORMAL) {
-        //
-        // No action needed for NORMAL connections
-        //
-        return;
-    }
+    if (!discard) {
+        qdr_connection_t *conn = action->args.connection.conn;
+        DEQ_ITEM_INIT(conn);
+        DEQ_INSERT_TAIL(core->open_connections, conn);
 
-    if (conn->role == QDR_ROLE_INTER_ROUTER) {
-        //
-        // Assign a unique mask-bit to this connection as a reference to be used by
-        // the router module
-        //
-        if (qd_bitmask_first_set(core->neighbor_free_mask, &conn->mask_bit))
-            qd_bitmask_clear_bit(core->neighbor_free_mask, conn->mask_bit);
-        else {
-            qd_log(core->log, QD_LOG_CRITICAL, "Exceeded maximum inter-router connection
count");
+        if (conn->role == QDR_ROLE_NORMAL) {
+            //
+            // No action needed for NORMAL connections
+            //
             return;
         }
 
-        if (!conn->incoming) {
+        if (conn->role == QDR_ROLE_INTER_ROUTER) {
             //
-            // The connector-side of inter-router connections is responsible for setting
up the
-            // inter-router links:  Two (in and out) for control, two for routed-message
transfer.
+            // Assign a unique mask-bit to this connection as a reference to be used by
+            // the router module
             //
-            (void) qdr_create_link_CT(core, conn, QD_LINK_CONTROL, QD_INCOMING, qdr_terminus_router_control(),
qdr_terminus_router_control());
-            (void) qdr_create_link_CT(core, conn, QD_LINK_CONTROL, QD_OUTGOING, qdr_terminus_router_control(),
qdr_terminus_router_control());
-            (void) qdr_create_link_CT(core, conn, QD_LINK_ROUTER,  QD_INCOMING, qdr_terminus_router_data(),
qdr_terminus_router_data());
-            (void) qdr_create_link_CT(core, conn, QD_LINK_ROUTER,  QD_OUTGOING, qdr_terminus_router_data(),
qdr_terminus_router_data());
+            if (qd_bitmask_first_set(core->neighbor_free_mask, &conn->mask_bit))
+                qd_bitmask_clear_bit(core->neighbor_free_mask, conn->mask_bit);
+            else {
+                qd_log(core->log, QD_LOG_CRITICAL, "Exceeded maximum inter-router connection
count");
+                return;
+            }
+
+            if (!conn->incoming) {
+                //
+                // The connector-side of inter-router connections is responsible for setting
up the
+                // inter-router links:  Two (in and out) for control, two for routed-message
transfer.
+                //
+                (void) qdr_create_link_CT(core, conn, QD_LINK_CONTROL, QD_INCOMING, qdr_terminus_router_control(),
qdr_terminus_router_control());
+                (void) qdr_create_link_CT(core, conn, QD_LINK_CONTROL, QD_OUTGOING, qdr_terminus_router_control(),
qdr_terminus_router_control());
+                (void) qdr_create_link_CT(core, conn, QD_LINK_ROUTER,  QD_INCOMING, qdr_terminus_router_data(),
qdr_terminus_router_data());
+                (void) qdr_create_link_CT(core, conn, QD_LINK_ROUTER,  QD_OUTGOING, qdr_terminus_router_data(),
qdr_terminus_router_data());
+            }
         }
+
+        //
+        // If the role is ON_DEMAND:
+        //    Activate waypoints associated with this connection
+        //    Activate link-route destinations associated with this connection
+        //
     }
 
-    //
-    // If the role is ON_DEMAND:
-    //    Activate waypoints associated with this connection
-    //    Activate link-route destinations associated with this connection
-    //
+    qdr_field_free(action->args.connection.container_id);
 }
 
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e51dd8c0/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h b/src/router_core/router_core_private.h
index 9eb2726..f6de278 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -84,6 +84,7 @@ struct qdr_action_t {
         struct {
             qdr_connection_t *conn;
             const char       *label;
+            qdr_field_t      *container_id;
             qdr_link_t       *link;
             qdr_delivery_t   *delivery;
             qd_message_t     *msg;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e51dd8c0/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index 373f176..2b2b7b8 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -446,10 +446,13 @@ static void router_opened_handler(qd_router_t *router, qd_connection_t
*conn, bo
     bool                   strip_annotations_in;
     bool                   strip_annotations_out;
     const char            *label;
+    pn_connection_t       *pn_conn = qd_connection_pn(conn);
 
-    qd_router_connection_get_config(conn, &role, &label, &strip_annotations_in,
&strip_annotations_out);
+    qd_router_connection_get_config(conn, &role, &label,
+                                    &strip_annotations_in, &strip_annotations_out);
 
     qdr_connection_t *qdrc = qdr_connection_opened(router->router_core, inbound, role,
label,
+                                                   pn_connection_remote_container(pn_conn),
                                                    strip_annotations_in, strip_annotations_out);
 
     qd_connection_set_context(conn, qdrc);


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


Mime
View raw message