DISPATCH-179 - Hook the connection lifecycle into the router_node.

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

Branch: refs/heads/tross-DISPATCH-179-1
Commit: c50da0faf00ff9984de9118296895d987e45e89c
Parents: 511d31b
Author: Ted Ross <[email protected]>
Authored: Mon Nov 9 17:10:18 2015 -0500
Committer: Ted Ross <[email protected]>
Committed: Mon Nov 9 17:10:18 2015 -0500

----------------------------------------------------------------------
 src/router_node.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/c50da0fa/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index 639a9bf..7d6635b 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -1665,12 +1665,19 @@ static int router_link_detach_handler(void* context, 
qd_link_t *link, qd_detach_
 
 static void router_inbound_opened_handler(void *type_context, qd_connection_t 
*conn, void *context)
 {
+    qd_router_t *router = (qd_router_t*) type_context;
+    qdr_connection_t *qdrc = qdr_connection_opened(router->router_core, 0); // 
TODO - get label
+    qd_connection_set_context(conn, qdrc);
+    qdr_connection_set_context(qdrc, conn);
 }
 
 
 static void router_outbound_opened_handler(void *type_context, qd_connection_t 
*conn, void *context)
 {
     qd_router_t *router = (qd_router_t*) type_context;
+    qdr_connection_t *qdrc = qdr_connection_opened(router->router_core, 0); // 
TODO - get label
+    qd_connection_set_context(conn, qdrc);
+    qdr_connection_set_context(qdrc, conn);
 
     //
     // If the connection is on-demand, visit all waypoints that are waiting 
for their
@@ -1755,6 +1762,9 @@ static void router_outbound_opened_handler(void 
*type_context, qd_connection_t *
 
 static void router_closed_handler(void *type_context, qd_connection_t *conn, 
void *context)
 {
+    qdr_connection_t *qdrc = (qdr_connection_t*) 
qd_connection_get_context(conn);
+    qdr_connection_closed(qdrc);
+    qd_connection_set_context(conn, 0);
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to