ted-ross commented on a change in pull request #502: DISPATCH-1326 - Handling 
of anonymous messages sent to edge routers. …
URL: https://github.com/apache/qpid-dispatch/pull/502#discussion_r281825449
 
 

 ##########
 File path: src/router_core/transfer.c
 ##########
 @@ -616,12 +628,46 @@ static void qdr_link_deliver_CT(qdr_core_t *core, 
qdr_action_t *action, bool dis
     //
 
     if (DEQ_IS_EMPTY(link->undelivered)) {
+        qdr_link_ref_t *temp_rlink = 0;
         qdr_address_t *addr = link->owning_addr;
         if (!addr && dlv->to_addr) {
             qdr_connection_t *conn = link->conn;
             if (conn && conn->tenant_space)
                 qd_iterator_annotate_space(dlv->to_addr, conn->tenant_space, 
conn->tenant_space_len);
             qd_hash_retrieve(core->addr_hash, dlv->to_addr, (void**) &addr);
+
+            if (!addr) {
+                qd_log(core->log, QD_LOG_INFO, "yoyoma Addr not in address 
table %s - %p\n", qd_iterator_copy(dlv->to_addr), (void *)core->addr_hash);
+                //
+                // This is an anonymous delivery but the address that it wants 
sent to is
+                // not in this router's address table. We will send this 
delivery up the
+                // anonymous link to the interior router (if this is an edge 
router).
+                // Only edge routers have a non null core->edge_conn_addr
+                //
+                if (core->edge_conn_addr && link->conn->role != 
QDR_ROLE_EDGE_CONNECTION) {
+                    qdr_address_t *sender_address = 
core->edge_conn_addr(core->edge_context);
+                    if (sender_address) {
+                        addr = sender_address;
+                    }
+                }
+            }
+            else {
+                //
+                // (core->edge_conn_addr is non-zero ONLY on edge routers. So 
there is no need to check if the
+                // core->router_mode is edge.
+                //
+                // The connection on which the delivery arrived should not be 
QDR_ROLE_EDGE_CONNECTION because
+                // we do not want to send it back over the same connections
+                //
+                if (core->edge_conn_addr && link->conn->role != 
QDR_ROLE_EDGE_CONNECTION && qdr_is_addr_treatment_multicast(addr)) {
+                    qdr_address_t *sender_address = 
core->edge_conn_addr(core->edge_context);
+                    if (sender_address && sender_address != addr) {
+                        temp_rlink = DEQ_HEAD(sender_address->rlinks);
+                        if (temp_rlink)
+                            DEQ_INSERT_TAIL(addr->rlinks, temp_rlink);
 
 Review comment:
   This is inserting the rlink onto addr->rlinks while it is still on the head 
of sender_address->rlinks.  This is not a safe or valid thing to do.  The 
reference can't be on two lists at the same time.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to