kgiusti commented on a change in pull request #554: DISPATCH-1266: Fix 
unsettled multicast forwarding
URL: https://github.com/apache/qpid-dispatch/pull/554#discussion_r317628990
 
 

 ##########
 File path: src/router_core/delivery.c
 ##########
 @@ -558,81 +572,386 @@ void qdr_delivery_decref_CT(qdr_core_t *core, 
qdr_delivery_t *dlv, const char *l
 }
 
 
+// the remote endpoint has change the state (disposition) or settlement for the
+// delivery.  Update the local state/settlement accordingly.
+//
 static void qdr_update_delivery_CT(qdr_core_t *core, qdr_action_t *action, 
bool discard)
 {
-    qdr_delivery_t *dlv        = action->args.delivery.delivery;
-    qdr_delivery_t *peer       = qdr_delivery_first_peer_CT(dlv);
-    bool            push       = false;
-    bool            peer_moved = false;
-    bool            dlv_moved  = false;
-    uint64_t        disp       = action->args.delivery.disposition;
-    bool            settled    = action->args.delivery.settled;
-    qdr_error_t    *error      = action->args.delivery.error;
-    bool error_unassigned      = true;
+    if (discard)
+        return;
+
+    qdr_delivery_t *dlv      = action->args.delivery.delivery;
+    qdr_delivery_t *peer     = qdr_delivery_first_peer_CT(dlv);
+    uint64_t        new_disp = action->args.delivery.disposition;
+    bool            settled  = action->args.delivery.settled;
+    qdr_error_t    *error    = action->args.delivery.error;
+    bool free_error          = true;
+
+    if (dlv->multicast) {
+        //
+        // remote state change for *inbound* multicast delivery,
+        // update downstream *outbound* peers
+        //
+        qdr_delivery_mcast_update_CT(core, dlv, new_disp, settled);
 
-    qdr_link_t *dlv_link  = qdr_delivery_link(dlv);
-    qdr_link_t *peer_link = qdr_delivery_link(peer);
+    } else if (peer && peer->multicast) {
+        //
+        // remote state change for an *outbound* delivery to a multicast 
address,
+        // propagate upstream to *inbound* delivery (peer)
+        //
+        // coverity[swapped_arguments]
+        qdr_delivery_mcast_peer_update_CT(core, peer, dlv, new_disp, settled);
+
+    } else {
+        //
+        // Unicast forwarding
+        //
+        free_error = !qdr_delivery_ucast_update_CT(core, dlv, peer, new_disp, 
settled, error);
 
 Review comment:
   ucast-->anycast

----------------------------------------------------------------
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