grs commented on a change in pull request #567: DISPATCH-1428
URL: https://github.com/apache/qpid-dispatch/pull/567#discussion_r326291511
 
 

 ##########
 File path: src/router_core/route_control.c
 ##########
 @@ -625,9 +595,65 @@ void qdr_route_connection_closed_CT(qdr_core_t *core, 
qdr_connection_t *conn)
         //
         qdr_del_connection_ref(&cid->connection_refs, conn);
 
-        conn->conn_id        = 0;
-
         qdr_route_check_id_for_deletion_CT(core, cid);
+}
+
+void qdr_route_connection_opened_CT(qdr_core_t       *core,
+                                    qdr_connection_t *conn,
+                                    qdr_field_t      *container_field,
+                                    qdr_field_t      *connection_field)
+{
+    if (conn->role != QDR_ROLE_ROUTE_CONTAINER)
+        return;
+
+    if (connection_field) {
+        qdr_conn_identifier_t *cid = qdr_route_declare_id_CT(core, 0, 
connection_field->iterator);
+        qdr_add_connection_ref(&cid->connection_refs, conn);
+        conn->conn_id = cid;
+        activate_route_connection(core, conn, conn->conn_id);
+        if (container_field) {
+            cid = qdr_route_declare_id_CT(core, container_field->iterator, 0);
+            qdr_add_connection_ref(&cid->connection_refs, conn);
 
 Review comment:
   It would result in an extra connection ref being added for the same 
connection, which would probably not be removed when the connection goes away 
as it would only remove the first ref, so the cid would indeed then not be 
eligible for removal at that point.
   
   I'll move the qdr_add_connection_ref after the cid comparison.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to