kgiusti commented on a change in pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997#discussion_r563821097



##########
File path: src/router_core/transfer.c
##########
@@ -222,10 +222,12 @@ int qdr_link_process_deliveries(qdr_core_t *core, 
qdr_link_t *link, int credit)
                     }
                 }
                 else if (new_disp == QD_DELIVERY_MOVED_TO_NEW_LINK) {
-                    DEQ_REMOVE_HEAD(link->undelivered);
-                    dlv->link_work = 0;
-                    dlv->where = QDR_DELIVERY_NOWHERE;
-                    qdr_delivery_decref(core, dlv, 
"qdr_link_process_deliveries - moved from undelivered list to some other link");
+                    if (DEQ_HEAD(link->undelivered) != 0) {

Review comment:
       IIUC this check is necessary since the call into the delivery_handler 
may have already removed the head delivery, correct?
   
   If the delivery_handler has modified the list can we be sure that - if 
DEQ_HEAD(link->undelivered) !=0 - the head delivery is the same delivery as 
"dlv"?  This may be a good place for an assert(DEQ_HEAD(link->undelivered) == 
dlv) to ensure that this expectation doesn't silently break at some point.




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



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

Reply via email to